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

每类试卷得分前3名

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

(select tag,uid,rank()over( order by g desc,d desc,uid desc) from(select tag,uid,max(score) g,min(score) d from examination_info join exam_record using(exam_id) where score is not null and tag='C++' group by uid) a limit 3) union (select tag,uid,rank()over( order by g desc,d desc,uid desc) from(select tag,uid,max(score) g,min(score) d from examination_info join exam_record using(exam_id) where score is not null and tag='SQL' group by uid) a limit 3) union (select tag,uid,dense_rank()over( order by g desc,d desc,uid desc) from(select tag,uid,max(score) g,min(score) d from examination_info join exam_record using(exam_id) where score is not null and tag='算法' group by uid) a limit 3)

全部评论

相关推荐

爱看电影的杨桃allin春招:我感觉你在炫耀
点赞 评论 收藏
分享
10-24 13:36
门头沟学院 Java
Zzzzoooo:更新:今天下午有hr联系我去不去客户端,拒了
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务