これは簡単にできます
select @count:[email protected]+1 as SNO, col1, col2
FROM table, (SELECT @count:=0) r ;
各行にRowNumberを追加するのと同じように
select @rownum:[email protected]+1 ‘rank’,
p.*
from player p, (SELECT @rownum:=0) r
order by score
desc limit 10;