题解 | #作答试卷得分大于过80的人的用户等级分布#
作答试卷得分大于过80的人的用户等级分布
https://www.nowcoder.com/practice/5bc77e3a3c374ad6a92798f0ead4c744
with cte_get_uid as ( select uid, level from user_info join exam_record using(uid) join examination_info using(exam_id) where tag='SQL' and score>80 ) # with 子查询获取符合条件的用户 select level, count(uid) as level_cnt # 对等级分组后计算每组uid数量 from cte_get_uid group by level order by level_cnt desc # 降序排序