HI,
I actually posted similar (or same?) question yesterday, but I thought I need to post a new question since I have short, but clear question.
I have the f
SET @rank = 0, @prev_val = NULL; SELECT id, @rank := IF(@prev_val=points,@rank,@rank+1) AS rank, @prev_val := points AS points FROM users ORDER BY points DESC, id asc;
Table:users