My database has say abt 8 Categoreies and each category has one or more sub categories.
Eg:
Categorey Count(Sub-Category)
1 2
2 1
3 2
4 3
5 3
6 2
7 5
8 4
So from above we see that category number 4 has 3 subcategories.
I wrote the following query to get the above output:
select count(sub-categorey) from table_name where Group By Category
But now I want to select a count of the Categories with more than 3 sub categories.
So I want the following output
Count(category)
2
Because there are two categories that have more than 3 sub-categories i.e. categorey number 7 and 8.
Please tell me what will be the query for that.
Eg:
Categorey Count(Sub-Category)
1 2
2 1
3 2
4 3
5 3
6 2
7 5
8 4
So from above we see that category number 4 has 3 subcategories.
I wrote the following query to get the above output:
select count(sub-categorey) from table_name where Group By Category
But now I want to select a count of the Categories with more than 3 sub categories.
So I want the following output
Count(category)
2
Because there are two categories that have more than 3 sub-categories i.e. categorey number 7 and 8.
Please tell me what will be the query for that.