MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Rick Emery Date:February 13 2002 1:22pm
Subject:RE: Re: Indexes on UPDATE/DELETE
View as plain text  
>Also, how do I reset an auto-increment value back to 1 (with all
>rows being already deleted of course).

The following deletes all records and re-starts renumbering from 1;
DELETE FROM mytable;

The following deletes all records and continues counting from where the
table last left off:
DELETE FROM mytable WHERE 1;

-----Original Message-----
From: Paul DuBois [mailto:paul@stripped]
Sent: Saturday, February 09, 2002 4:50 PM
To: mysql@stripped
Subject: Re: Re: Indexes on UPDATE/DELETE


sql,query

At 15:35 -0700 2/9/02, Andrei Cojocaru wrote:
>Also, how do I reset an auto-increment value back to 1 (with all
>rows being already deleted of course).

ALTER TABLE tbl_name AUTO_INCREMENT = 1;

>
>Thanks for your help in advance.

---------------------------------------------------------------------
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 <mysql-thread99041@stripped>
To unsubscribe, e-mail <mysql-unsubscribe-cyon=bestweb.net@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
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 <mysql-thread99441@stripped>
To unsubscribe, e-mail <mysql-unsubscribe-remery=excel.com@stripped>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Thread
Re: Re: Indexes on UPDATE/DELETEPaul DuBois9 Feb
Re: Re: Indexes on UPDATE/DELETEPaul DuBois12 Feb
RE: Re: Indexes on UPDATE/DELETERick Emery13 Feb