mysql group by

SELECT 'not_distinct' a, count(*) cnt,val FROM analysis_debug
group by val
union all
SELECT 'distinct' a, count(distinct(user_id)) cnt,val FROM analysis_debug
group by val
union all
SELECT 'not_distinct-2' a, count(user_id) cnt,val FROM analysis_debug
group by val

 

 

 

posted @ 2025-06-10 12:57  papering  阅读(8)  评论(0)    收藏  举报