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

统计每种性别的人数

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

select gender, count(device_id) as number
from (
    select device_id, substring_index(profile, ',', -1) as gender
    from user_submit
) as b
group by gender;

全部评论
先将profile字段中的性别提取出来,然后根据性别进行分组
点赞 回复 分享
发布于 2023-07-31 15:20 江苏

相关推荐

12-11 14:24
门头沟学院 Java
牛客35720396...:不要用boss,全是骗
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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