>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:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 4:50 PM
To: [EMAIL PROTECTED]
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to