Leandro Melo <[EMAIL PROTECTED]> wrote: > If it`s a InnoDB table :-? my case
If you want to start auto_increment sequence from the beginning, you must recreate InnoDB table. > --- Paul DuBois <[EMAIL PROTECTED]> escreveu: > At 12:27 > -0300 4/29/04, Leandro Melo wrote: >> >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; >> -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]