Write a solution to find the rank of the scores. The ranking should be calculated according to the following rules:
Return the result table ordered by score in descending order.
The result format is in the following example.
RANK()
는 1등이 둘이면, 1, 1, 3 ...
으로 순위를 부여한다.DENSE_RANK()
는 1등이 둘이면, 1, 1, 2 ...
으로 부여함.SELECT score,
DENSE_RANK() OVER (ORDER BY score DESC) AS 'rank'
FROM Scores
ORDER BY score DESC