感觉第二问和第一问考的一样啊,就是多来一次选最大而已 row_number()和max()都行 with temp as ( select t1.name, t1.subject, t1.score,  ( case t1.subject when '语文&(8803)#39; then 3 when '数学' then 2 when '英语&(8805)#39; 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 )