SQL/SQL 문제풀이
[SQL] LeetCode SQL 178. Rank Scores (DENSE_RANK)
웅겹사r☆
2021. 12. 19. 22:35
https://leetcode.com/problems/rank-scores/
Rank Scores - LeetCode
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
leetcode.com
-- MYSQL
SELECT
score
, DENSE_RANK() OVER (ORDER BY score DESC ) 'rank'
FROM Scores;
-- ORACLE
SELECT
score
, DENSE_RANK() OVER (ORDER BY score DESC ) as rank
FROM Scores;