select age_cut,count(age_cut) as number from -- 子查询 (select *, (case when age<25 or age is null then'25岁以下' when age>=25 then'25岁及以上' end) as age_cut from user_profile) as a group by age_cut;