窗口函数
select t.id,l.name,t.score FROM (select *,DENSE_RANK()over(partition by language_id order BY score desc ) dr FROM grade) t JOIN language l on t.language_id=l.id WHERE t.dr<=2 ORDER BY l.name,t.score desc,t.id
窗口函数
select t.id,l.name,t.score FROM (select *,DENSE_RANK()over(partition by language_id order BY score desc ) dr FROM grade) t JOIN language l on t.language_id=l.id WHERE t.dr<=2 ORDER BY l.name,t.score desc,t.id