题解 | #统计每种性别的人数#

统计每种性别的人数

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

##使用通配符'%'进行模糊查询,使用下划线模糊匹配,查询第15个字符是'm'的记作'male',是'f'的,记作'female'


select
case 
when profile
like '______________m%'
then 
'male'
when profile like '______________f%'
then
'female'
end gender,
count(*) number
from 
user_submit
group by
gender;


全部评论

相关推荐

头像
10-15 22:27
已编辑
门头沟学院 C++
罗格镇的小镇做题家:我投了hr打电话来说学历太低了不符合要求,建议投荣耀,结果荣耀也投了一定水花没有,非本211硕
投递华为等公司10个岗位
点赞 评论 收藏
分享
LemonTree果:学历本科,加上嵌入式寒冬,试一试小公司看看行不行
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务