牛客SQL练习-74-考试分数(三)
程序员文章站
2022-06-07 13:14:20
...
SELECT
g.id,
l.NAME,
g.score
FROM
( SELECT *, dense_rank () over ( PARTITION BY language_id ORDER BY score DESC ) AS rank FROM grade ) g,
LANGUAGE l
WHERE
g.language_id = l.id
AND g.rank <= 2
ORDER BY
l.NAME ASC,
g.score DESC,
g.id ASC
上一篇: PTA甲级考试真题练习22——1022 Digital Library
下一篇: 练习赛牛客