select T1.Score,T1.rank from (select Score ,
case when @last > Score then @rank := @rank +1
when @last = @last:=Score then @rank := @rank
end as rank
from Scores order by Score DESC ) T1,
(select @rank:=1 ,@last :=(select Score from Scores order By Score DESC limit 0,1)) T2
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.