Jeff Snoxell wrote: > At 09:46 19/12/02 -0500, you wrote: > >Jeff Snoxell wrote: > > > >>Nope. That doesn't do it either! > >> > >>I go: > >> > >>TRUNCATE TABLE my_table > > > >Are you using InnoDB tables? You'll have to do something akin to ALTER > >TABLE my_table AUTO_INCREMENT=1 ... at least according to Paul ... :) > > No, I'm using MyISAM I believe. > > Jeff
If you want to set the ID back to zero, then I assume you are deleteing all of the records in the table. If so, why not simply drop the table and recreate it? Seems to work for me as the session below demonstrates. If you want to do something else, you better ask again so we can answer you real question. ================ clip ================ mysql> create table test ( id int auto_increment, d int, primary key (id) ); Query OK, 0 rows affected (0.00 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.00 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.00 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.00 sec) mysql> select * from test; +----+------+ | id | d | +----+------+ | 1 | 2 | | 2 | 2 | | 3 | 2 | +----+------+ 3 rows in set (0.00 sec) mysql> drop table test; Query OK, 0 rows affected (0.00 sec) mysql> create table test ( id int auto_increment, d int, primary key (id) ); Query OK, 0 rows affected (0.00 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.01 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.00 sec) mysql> insert into test (d) values (2); Query OK, 1 row affected (0.00 sec) mysql> select * from test; +----+------+ | id | d | +----+------+ | 1 | 2 | | 2 | 2 | | 3 | 2 | +----+------+ 3 rows in set (0.00 sec) mysql> ================= end clip ================= -- Will Will Merrell Virtual Assistant [EMAIL PROTECTED] Moreland Business Solutions - Your partner in business. http://www.morelandsolutions.com --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php