add auto-increment field to fix table with no primary key - help

2005-01-30 Thread leegold
I have a table with no primary key. I would like to add a new auto-increment column field to each record - that would be the easiest way to remedy this. Eg. 1,2,3,4tagged onto each record successively. Is this possible with SQL? I also have PHP to use as well if needed. Thanks -- MySQL

Re: add auto-increment field to fix table with no primary key - help

2005-01-30 Thread Michael Stassen
ALTER TABLE yourtable ADD id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY; See the manual for details http://dev.mysql.com/doc/mysql/en/alter-table.html. Michael leegold wrote: I have a table with no primary key. I would like to add a new auto-increment column field to each record - that