题解 | #每个6/7级用户活跃情况#
每类试卷得分前3名
http://www.nowcoder.com/practice/255aa1863fe14aa88694c09ebbc1dbca
select *
from
(select tag,uid,ROW_NUMBER()over(partition by tag order by max(score) desc,min(score) desc,uid desc) as ranking
from examination_info t
join exam_record t1 on t.exam_id = t1.exam_id
group by tag,uid) t1
where ranking <=3