Equivalent of Oracle’s RowID in MySQL

In MySql you usually use session variables to achive the functionality: SELECT @rowid:=@rowid+1 as rowid FROM table1, (SELECT @rowid:=0) as init ORDER BY sorter_field But you can not make sorts on the table you are trying to delete from in subqueries. UPD: that is you will need to create a temp table, insert the ranging … Read more