I have the below SQL query from Stack Overflow, and it's working perfectly. This is the link to the original answer.
I want the below query to output the rank in the following order if there is any tie:
1,1,3,4,5,6,6,6,9,10.... etc.
This is the SQL query:
SELECT idno, name, rank,total_score
FROM (SELECT *, IF(@marks=(@marks:=total_score), @auto, @auto:=@auto+1) AS rank
FROM (SELECT * FROM
(SELECT idno, name, SUM(score) AS total_score
FROM jbit,
(SELECT @auto:=0, @marks:=0) as init
GROUP BY name) sub ORDER BY total_score DESC)t) as result
WHERE idno ='1'