Rank Score by use Count function


  • 0
    Y
    SELECT Score,
      (SELECT count(*) FROM (SELECT distinct Score s FROM Scores) tmp WHERE s >= Score) Rank
    FROM Scores
    ORDER BY Score desc
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.