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

每类试卷得分前3名

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

#每个用户在每个试卷下的最大分和最小分
with a as
(select tag,uid,max(score) as max_score,min(score) as min_score
from examination_info ei
join exam_record er on ei.exam_id = er.exam_id
group by tag,uid)


#每类试卷得分的前3名
select * from
(select tag,uid,row_number() over(partition by tag order by max_score desc,min_score desc,uid desc) as ranking
from a)b
where ranking<4

二刷

全部评论

相关推荐

2025-11-26 11:32
已编辑
好未来_go开发(实习员工)
不服输的咸鱼很聪明:还给打电话呀,我的没给我打电话呢
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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