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

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

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

条件函数if、case when 表达式 then、case 表达式 when then

case when 表达式 then 写法

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

if 条件写法

select if(age<25 or age is null,"25岁以下","25岁及以上") age_cut, count(*) number from user_profile group by age_cut

全部评论

相关推荐

嵌入式的小白:简历都没过,说明简历匹配度不行,这个需要你看看投递的岗位描述,看人家需要什么技术,然后针对性的修改
0offer互助地
点赞 评论 收藏
分享
专业嗎喽:个人信息名字太大,合到电话邮箱那一栏就行,有党员写过党,剩下其他全删,站空太大了 把实习经历丰富,放最前面,然后是个人评价,技能之类的,然后是学校信息。项目经历最后面,可以就选一个自己擅长的。 现在是学校不是92就扣分的,没必要放前面。 然后现在看重实习经历>竞赛经历(校园经历)>课程项目经历
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务