I need some help dealing with ties when ranking in MySQL. For example:
PLAYER | POINTS
- Mary: 90
- Bob: 90
- Jim: 65
- Kevin: 12
Bob and Mary should both be ranked #1. Jim should be #3. Kevin should be #4.
MySQL:
SET @rank=0;
SELECT @rank:=@rank +1 as rank, player, points FROM my_table
How can I change the SELECT statement so that the ranking is correct in the case of ties?
My real life problem is more complicated, but if I understand how to solve the above, then I should be set.