I need you save my live.
I have a table with a LOT of rows. One of the fields are id, it have auto_increment.
For legally reasons, now I need to have another auto increment field (not auto_numeric, I will be control this manually). It fields in the firs row starts at 567.
How I can add i exists rows the new correlative number? 568 ,569, 570…
I found the solution:
SET @pos =566;
UPDATE mytable SET field_id2 = ( SELECT @pos := @pos +1 ) ORDER BY id ASC;