分析思路:
1.将用户划分成25岁以上和25岁以下用户
select case when age >= 25 then '25岁及以上' else '25岁以下' end age_cut from user_profile2.将查询到的结果作为表,再进行分组,并使用聚合函数count
解题思路:
select age_cut,count(*) "number" from (select case when age >= 25 then '25岁及以上' else '25岁以下' end age_cut from user_profile ) t_age_cut group by age_cut;



京公网安备 11010502036488号