On Tuesday, August 12, 2003, at 09:46 PM, Andrew Rothwell wrote:
Hello List, I have a movies database, that I had an autoincrementing field for counting purposes.What I did though was remove some of the rows out of the table, now my table is reporting an incorrect number of movies listed.What I am trying to do is after is have done the following command
[snip]
There is no 74 Is there a way to force the DB upon removal of a row (74)
to renumber the autoincremented fields?
Short answer, no.
I have tried to flush tables, but that did not work -
btw I am using the last stable 3 release - but I will be updating to the
latest stable 4 release in the next day or so. THank you
Andrew
Long answer: that defeats the purpose of an auto-increment.
The only good way to do this is to do it programatically, and even then (if there are multiple updates at a time) won't necessarily guarantee unique values (the point of the auto_increment field).
If all you need is the current number of movies, might I suggest: SELECT COUNT(*) FROM tablename;
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]