7 messages in com.mysql.lists.win32Re: auto id repair
FromSent OnAttachments
Hao Zhuang09 Apr 2001 13:35 
Paul DuBois09 Apr 2001 13:50 
Egil Helland09 Apr 2001 13:54 
Egil Helland09 Apr 2001 13:55 
Egil Helland09 Apr 2001 13:56 
Andre Moll10 Apr 2001 04:25 
Hao Zhuang10 Apr 2001 05:47 
Subject:Re: auto id repair
From:Paul DuBois (pa@snake.net)
Date:04/09/2001 01:50:30 PM
List:com.mysql.lists.win32

On Mon, Apr 09, 2001 at 04:36:20PM -0400, Hao Zhuang wrote:

I have several tables with id fields using auto_increment as the attribute. Sometimes I need to delete the old records, those number can not be reused any more. Is there any way I can rearrange those id numbers make them continuous?

Why bother? MySQL doesn't care whether or not they're continuous.

If you really want to do this, drop the column and add it again with ALTER TABLE. MySQL will assign new sequence numbers.

Example: id1: 1,2,3,4,5,6 after I deleted some records, I will have: 2,3,6 How can I rearrange the id, so that they are in order of :1,2,3

Did anybody do that kind of thing before?

Thanks, Hao