Puoi semplicemente farlo,
select @count:[email protected]+1 as SNO, col1, col2
FROM table, (SELECT @count:=0) r ;
Proprio come aggiungere RowNumber per ogni riga
select @rownum:[email protected]+1 ‘rank’,
p.*
from player p, (SELECT @rownum:=0) r
order by score
desc limit 10;
Aggiunta di RowNumber in MySQL