178.Rank Scores

  • 0

    select Scores.Score,rank from Scores left join
    (select @num:=@num+1 as rank,Score from (select distinct Score from Scores order by Score desc) AS sc,(select @num:=0) as it) as final on Scores.Score=final.Score order by final.Score desc;

Log in to reply

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