찌니의 프로그래밍 삼매경

[SQL] LeetCode SQL 178. Rank Scores (DENSE_RANK) 본문

SQL/SQL 문제풀이

[SQL] LeetCode SQL 178. Rank Scores (DENSE_RANK)

zzI니☆ 2021. 12. 19. 22:35
728x90

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;

 

728x90
Comments