Update table to get consecutive Primary keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All!

I've a MySQL table:

table (id INT NOT NULL AUTO_INCREMENT,
                                   flag TINYINT NOT NULL,
                                   msgID VARCHAR(30) NOT NULL,
                                   msgName VARCHAR(30),
                                   size INT NOT NULL,
                                   PRIMARY KEY(id));


If I delete a row, say 5th, the id entries are 1 2 3 4  6 7 ... 10.

I wish to keep entries consecutive, that is rearrange the table as 1 2 3 4 5
6 ... 9. How do I go about it?

Thanks & Regards,
Antonio

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux