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

统计每种性别的人数

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;


全部评论

相关推荐

喵_coding:项目太烂了外卖+点评啊 而且寒假实习差不多到时候了 hc没多少了 要实在想要找那只能投投大厂试试了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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