题解 | 每类试卷得分前3名
每类试卷得分前3名
https://www.nowcoder.com/practice/255aa1863fe14aa88694c09ebbc1dbca
with t as (select tag, uid, max(score) as max_score, min(score) as min_score from exam_record re left join examination_info info on re.exam_id = info.exam_id group by tag, uid), t2 as( select tag, uid, row_number() over (partition by tag order by max_score desc, min_score desc, uid desc) as ranking from t) select * from t2 where ranking <= 3

查看23道真题和解析