Count of total groups required. Group by cluased query in MySql
I want the count of a total groups.
I have following query. I want how many groups 开发者_如何转开发this query returned based on web_id. Lets suppose if it grouped under 4 groups. I need count 4.
select * from web_details where redirected = false group by web_id
I hope my question is understood.
I just figured it out how can I do this.
The ideas was so simple but I was not clicking it.
select count(*) from
(
select * from web_details
where redirected = false group by web_id
) as temp;
精彩评论