Hi, i got a table wich its pk is an auto_increment field. I have 10 elements in this table, wich makes the pk_id field = 10. I inserted incorrectly anoter row in this table (the 11th) and imediately deleted it. Although, i'd like that the next time i insert a row in this table, it's index be still 11 (not 12 as mysql would do by default). Is there any fast command i can make to correct the table situation?
If it's a MyISAM table, yes, although you might ask yourself whether there's really any need to do so. (Answer: nearly always not.)
This statement will cause the next AUTO_INCREMENT value generated to be one more than the current maximum value in the column:
ALTER TABLE tbl_name AUTO_INCREMENT = 1;
-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]