11 messages in com.mysql.lists.mysqlre-numbering auto-increment column
FromSent OnAttachments
Andy Loughe06 Nov 2000 13:42 
dan06 Nov 2000 13:59 
dan06 Nov 2000 14:19 
Robert Goff06 Nov 2000 14:38 
Don Read06 Nov 2000 19:22 
ed...@innovateit.se07 Nov 2000 01:08 
dan07 Nov 2000 06:44 
ed...@innovateit.se07 Nov 2000 07:36 
Jason Terry07 Nov 2000 08:11 
Carsten H. Pedersen07 Nov 2000 08:29 
Slah Elachtar08 Nov 2000 01:09 
Subject:re-numbering auto-increment column
From:dan (da@mojolin.com)
Date:11/06/2000 01:59:45 PM
List:com.mysql.lists.mysql

Hi,

Because of deleted rows, I need to renumber my auto_increment column. The book by Paul Dubois shows two methods, neither of which work for me.

One drops the field and then adds it back in. This works, however it breaks all of my queries because it adds the field back in as the last one in the table.

The other errors out at me about format.

here is a simple dump of a table I'm using:

mysql> describe email_agent; +----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+----------------+ | id | int(5) | | PRI | 0 | auto_increment | | email | varchar(40) | | UNI | | | | format | varchar(6) | | | | | | password | varchar(10) | | | | | | service | varchar(8) | | | | | +----------+-------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec)

When I do the renumbering, th id field needs to maintain its position.

thanks,