题解 | #考试分数(三)#
考试分数(三)
http://www.nowcoder.com/practice/b83f8b0e7e934d95a56c24f047260d91
select a.id, a.name, a.score
from (select g.id,g.score,l.name, dense_rank() over(partition by l.id order by g.score desc) rk
from grade g
left join language l on g.language_id = l.id) a
where a.rk < 3
order by a.name asc, a.score desc