题解 | #查看不同年龄段的用户明细#

查看不同年龄段的用户明细

https://www.nowcoder.com/practice/ae44b2b78525417b8b2fc2075b557592

select device_id, gender, '20岁以下' as age_cut
from user_profile
where age < 20
union all
select device_id, gender, '20-24岁' as age_cut
from user_profile
where age between 20 and 24
union all
select device_id, gender, '25岁及以上' as age_cut
from user_profile
where age >= 25
union all
select device_id, gender, '其他' as age_cut
from user_profile
where age IS NULL
order by device_id;

全部评论
题目要按照device_id排序就说啊,可恶,我看评论才知道,题目不严谨啊
点赞 回复 分享
发布于 2023-07-31 14:51 江苏

相关推荐

King987:模板换一个,这个有些丑,在校生的话建议丰富一下在校经历,各种比赛之类的,项目的话你名字是一点儿不包装呀,还有项目描述,像是直接从课程里抄出来的,这里建议自己再改改,说白了就是自己包装一下,改不好可以聊我
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务