I\'m trying to get my head around a query and I just can\'t figure it out. I would appreciate if someone give me a pointer. As a simple example of what I\'m trying to achiev
In MySQL, you can use row_number.
Here's an example of using it in a SELECT:
SELECT
select @rownum:=@rownum+1 ‘rank’, p.* from player p, (SELECT @rownum:=0) r order by score desc;
If you INSERT INTO using a SELECT like this, you will get your rankings.
INSERT INTO