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