11 messages in com.mysql.lists.mysqlre-numbering auto-increment column| From | Sent On | Attachments |
|---|---|---|
| Andy Loughe | 06 Nov 2000 13:42 | |
| dan | 06 Nov 2000 13:59 | |
| dan | 06 Nov 2000 14:19 | |
| Robert Goff | 06 Nov 2000 14:38 | |
| Don Read | 06 Nov 2000 19:22 | |
| ed...@innovateit.se | 07 Nov 2000 01:08 | |
| dan | 07 Nov 2000 06:44 | |
| ed...@innovateit.se | 07 Nov 2000 07:36 | |
| Jason Terry | 07 Nov 2000 08:11 | |
| Carsten H. Pedersen | 07 Nov 2000 08:29 | |
| Slah Elachtar | 08 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,
Dan Barber Mojolin: The Open Source/Linux Employment Site http://www.mojolin.com




