Rank Scores

https://leetcode.com/submissions/detail/215945996/

Your runtime beats 39.28 % of mssql submissions.

LeetCode
/* Write your T-SQL query statement below */
SELECT a.Score, b.row as 'Rank' FROM Scores AS a
LEFT JOIN 
(
SELECT ROW_NUMBER() OVER(ORDER BY Score DESC) AS 'row', Score FROM 
    (SELECT DISTINCT Score FROM Scores) AS c
) AS b
ON a.Score = b.Score
ORDER BY Score Desc