I have a table with (id, score) and i m trying to write a query that will return the rank of a certain id ranked by order of score.
i got this far;
SET @i = 0;
SELECT id, @i:=@i+1 AS rank
FROM scores
ORDER BY score DESC;
which returns a table of ranks which is correct but i need to select just one of those rows specified by an id. Any ideas?
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --