题解 | #分群并计算群体人数#
分群并计算群体人数
https://www.nowcoder.com/practice/24319fd5c03e482c935783107114933d
划分年龄段(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