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 would be the easiest
way to remedy this. Eg. 1,2,3,4....tagged onto each record successively.

Is this possible with SQL? I also have PHP to use as well if needed.

Thanks


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to