开发者

Count of total groups required. Group by cluased query in MySql

开发者 https://www.devze.com 2023-01-15 20:14 出处:网络
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.

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

精彩评论

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