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;

If you are trying to restart numbering while not deleting records,
forget-about-it.
-----Original Message-----
From: Wei Gao [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 2:10 PM
To: [EMAIL PROTECTED]
Subject: Reset auto_increment


Hi,
As I am new to MySQL, perhaps this is a common question you have been asked.

I have a field "Id" which using auto_increment. Now I want to reset the 
value of auto_increment, that is the "Id" starts form 1 and does not skip 
the number. I have spent a few hours to find a way, but all failed. Could 
you please tell me how to do it?

Wei

_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. 
http://www.hotmail.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

---------------------------------------------------------------------
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

  • ... Wei Gao
    • ... Rick Emery
      • ... Paul DuBois
    • ... Wei Gao
    • ... Rick Emery
    • ... INVALID - TESTING ONLY. IF YOU GET EMAIL WITH THIS ACCOUNT PLEASE REPLY TO [EMAIL PROTECTED] INSTEAD. OBVIOUSLY WE MADE A MISTAKE IF YOU ARE READING THIS
      • ... Paul DuBois
    • ... Mike Blezien
      • ... Trevor Rhodes

Reply via email to