SQL26 计算25岁以上和以下的用户数量 (CASE WHEN 运用)

 正确答案:

select case 
        when age <25 OR age is NULL then "25岁以下" 
        when age >=25 then "25岁及以上"
        end age_cut,count(*) number 
from user_profile
group by age_cut

猜你喜欢

转载自blog.csdn.net/weixin_45813351/article/details/121768372