Sequential Numbering with MySQL
This example will update position field of table tb_documents with sequential numbers.
update tb_documents set position =
(select @rownum:=@rownum+1 rownum FROM (SELECT @rownum:=0) r)
Source :
http://markmal.blogspot.com/2006/04/oracle-like-rownum-in-mysql.html
http://verysimple.com/2007/06/09/insert-sequential-numbers-in-mysql