感觉第二问和第一问考的一样啊,就是多来一次选最大而已 row_number()和max()都行 with temp as ( select t1.name, t1.subject, t1.score, ( case t1.subject when '语文' then 3 when '数学' then 2 when '英语' then 1 end ) as rk from Table t1 where (t1.name, t1.score) in ( select name, max(score) from Table t2 group by t2.name ) ) select t3.name, t3.subject, t3.score from temp t3 where (t3.name, t3.rk) in ( select t4.name, max(t4.rk) from temp t4 group by t4.name )
点赞 评论

相关推荐

notbeentak...:真的nc,算毕业6月份,要给这种b公司打半年多白工😅
点赞 评论 收藏
分享
東大沒有派對:这是好事啊(峰哥脸
我的秋招日记
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务