MySQL Forums
Forum List  »  Newbie

Re: Reseting Tables within the Database
Posted by: Shantanu Oak
Date: April 21, 2005 11:35PM

Drop the column from the table. Then put it back. MySQL will renumber the values in the column in unbroken sequence.

ALTER TABLE tbl_name DROP myid;

ALTER TABLE tbl_name ADD COLUMN myid INT AUTO_INCREMENT NOT NULL PRIMARY KEY;

Options: ReplyQuote


Subject
Written By
Posted
Re: Reseting Tables within the Database
April 21, 2005 11:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.