题解 | #某乎问答高质量的回答中用户属于各级别的数量#

某乎问答高质量的回答中用户属于各级别的数量

https://www.nowcoder.com/practice/69c85db3e59245efb7cee51996fe2273

select
    level_cut,sum(cnt) num
        from 
         (
            select
                case when a.author_level>=1 and a.author_level<=2 then '1-2级'
                when a.author_level>=3 and a.author_level<=4 then '3-4级'
                when a.author_level>=5 and a.author_level<=6 then '5-6级'
                else '0' end as level_cut,
                count(1) cnt
            from
                author_tb a,
                answer_tb b
            where
                a.author_id = b.author_id
                and char_len > 100
            group by
                a.author_level
        ) c
        group by c.level_cut
        order by sum(cnt) desc

全部评论

相关推荐

09-02 11:14
已编辑
四川大学 Java
吴offer选手:这种面试是最烦的,学不到东西,然后还被挂的莫名其妙。之前看到一种说法是面试官如果不想要你了,就会问一些很简单的问题,防止你举报他
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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