 <p>Create a table with an autoicrement id and the columns of the original table.</p> <p>Then</p> <pre><code>INSERT INTO new_table (column1, column2,.....) -- refer all columns except autoincrement id SELECT * FROM old_table </code></pre> <p>Update the old table by joining with the new, assuming the is a key composite or not that distincts each row</p>