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
1.4m articles
1.4m replys
5 comments
57.0k users