I have a bunch of huge tables that don't have primary keys. (Do not ask me why) I will add an id field for each table. It will be integer. Later I will push it to a non-zero index of unique value and a primary key.
My question is: is there a way in MySQL (5 ish). We have about a hundred tables, and most of them have more than 1 million records. By creating a new id column, is there a way to have MySQL backtrack (i.e. add a value to existing records) in the id field? I would rather do it all in MySQL. Otherwise, I will have to write a PHP script to populate the existing entries.
Thanx, Don!
source share