So I added a column in the table for the numbering. I would like to go through all the rows in the table and number them from 1 onwards. How would you go about doing this?
Asked
Active
Viewed 111 times
1 Answers
2
Just use AUTO_INCREMENT. It will automatically update your existing rows and all future rows.
ALTER TABLE tablename CHANGE id id INT(10) AUTO_INCREMENT PRIMARY KEY;
John Conde
- 212,985
- 98
- 444
- 485
-
Ah that's cool, thanks! – Fake Name Feb 17 '13 at 21:33