题解 | #每类试卷得分前3名#
每类试卷得分前3名
https://www.nowcoder.com/practice/255aa1863fe14aa88694c09ebbc1dbca
select * from ( SELECT tag as tid,uid, ROW_NUMBER() over(partition by tag ORDER BY max(score) desc,min(score) desc,uid desc ) as ranking from exam_record er join examination_info ei on er.exam_id=ei.exam_id group by tid,uid)t where ranking<=3; 经典题目