划分年龄段(when xx then xx end age_group)之后对年龄段分组(group by age_group) ,然后计算分组数量(count(*)user_count) select case when age > 50 then '50以上' when age > 20 then '20-50' when age < 50 then '20以下' else '未填写' end age_group, count(*)user_count from customers_info group by age_group