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

统计每种性别的人数

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

with
    data1 as (
        select
            count(*) as c1
        from
            user_submit
        where
            profile like "%,male"
    ),
    data2 as (
        select
            count(*) as c2
        from
            user_submit
        where
            profile like "%,female"
    )
SELECT
    'male' AS gender,
    data1.c1 AS male_count
FROM
    data1
union
select
    'female' AS gender,
    data2.c2 AS male_count
FROM
    data2;

全部评论

相关推荐

神哥了不得:你简历字体有点不太协调呀,下面的字实在太小了呀,而且项目也不太行,建议换几个高质量的项目,面试会多很多
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务