List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:May 23 2002 3:16am
Subject:Re: DELETE syntax and auto_increment 'reset'
View as plain text  
At 18:29 -0400 5/22/02, Jule wrote:
>Hey guys,
>when i delete a row using the query DELETE FROM $table WHERE id = "3" LIMIT 1;
>
>how can i make it that the id column (auto_increment) starts over from 1 and
>build up to however many rows there are without counting 1 2 4 5 6 etc.?

If you're asking how to fill in holes created by deleting rows from the
middle of the sequence, you can't.

Why would you want to?

If you're really determined to do this, you can renumber the entire
column so that the rows are sequential beginning with one.

>
>any ideas?
>
>Jule
>--
>
>|\/\__________________________/\/|
>|   Jule Slootbeek		 |
>|   jslootbeek@stripped	 |
>|   http://blindtheory.cjb.net	 |
>|   __________________________	 |
>|/\/			      \/\|

Thread
DELETE syntax and auto_increment 'reset'Jule23 May
  • Re: DELETE syntax and auto_increment 'reset'Paul DuBois23 May