题解 | #作答试卷得分大于过80的人的用户等级分布#

作答试卷得分大于过80的人的用户等级分布

https://www.nowcoder.com/practice/5bc77e3a3c374ad6a92798f0ead4c744

with t as (
    select uid, a.exam_id, b.tag, score
    from exam_record as a
    left join examination_info as b
    on a.exam_id = b.exam_id
)

select level, count(uid) as level_cnt
from (
    select c.uid, d.level
    from (
        select uid
        from t
        where tag = 'SQL' and score > 80
    ) as c
    left join user_info as d
    on c.uid = d.uid
) as e
group by level
order by level_cnt desc;

全部评论
使用with as可读性更强
点赞 回复 分享
发布于 2023-08-04 16:54 江苏

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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