In postgres there is a built in function generate_series() which can generate rows with number.
is there a function in mysql does same thing?
try this one:
select @rownum:=@rownum+1 n, t.* from tbl t, (SELECT @rownum:=0) r order by somefield
2.1m questions
2.1m answers
60 comments
57.0k users