开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜