题解 | #计算25岁以上和以下的用户数量#

计算25岁以上和以下的用户数量

http://www.nowcoder.com/practice/30f9f470390a4a8a8dd3b8e1f8c7a9fa

select '25岁以下',count(id) from user_profile where age is null||age<25
union 
select '25岁及以上',count(id) from user_profile where age>=25;
//注意select直接对一个常量,返回的就是这个常量
全部评论

相关推荐

04-08 10:36
已编辑
华南理工大学 C++
点赞 评论 收藏
分享
待现的未见之事:起码第一句要把自己的优势说出来吧。比如什么xx本27届学生,随时到岗....
点赞 评论 收藏
分享
05-16 09:20
已编辑
中国民航大学 Java
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务