First Step: We will first pull distinct score from Scores tables, then will rank them in decreasing order. /* this will be our first table for the inner join*/
Second Step: We will do inner join between our first table and the base table on score value.
c.score as Score,
CAST(d.rank as signed) as Rank
SELECT score, @rank:=@rank+1 AS rank from (select distinct score from Scores order by score desc) as b, (select @rank:=0) as a
where c.score = d.score
order by c.score desc
NOTE: Subquery used is for ranking the distinct score value in decreasing order.