题解 | #每类试卷得分前3名#

每类试卷得分前3名

https://www.nowcoder.com/practice/255aa1863fe14aa88694c09ebbc1dbca

select tag as tid,uid,ranking
from (
    select 
        tag,
        uid,
        row_number() over(
            partition by tag 
            order by tag, max(score) desc ,min(score) desc ,uid desc
        ) ranking
    from examination_info t1
    inner join exam_record t2
    on t1.exam_id = t2.exam_id
    group by tag,uid
) t
where ranking <= 3;

全部评论

相关推荐

安静的鲸鱼offer...:神仙级别hr,可遇不可求,甚至他可能也是突然有感而发。只能说遇上是件幸事。
秋招开始捡漏了吗
点赞 评论 收藏
分享
迷茫的大四🐶:干脆大厂搞个收费培训得了,这样就人均大厂了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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