List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:April 7 1999 2:00am
Subject:Re: how to start counting at a specific number?
View as plain text  
On Tue, Apr 06, 1999 at 06:26:30PM -0700, Daevid Vincent wrote:
> For reasons beyond my logical comprehension, my extremely
> irritating and stubborn boss wishes a database index to start
> at the number "142857" incrementing from there... I would love
> for that to be the Primary Key as well... Aside from loading
> 142856 bogus entries into the database before it so that the
> next one will start from there, is there a better way to tell
> mySQL to start a field at a specific number and increment up
> from there?

If you insert a single row that has a value of 142857, then the
next insert_id will be 142858.  Once you've got a single valid
row in there, you can remove your bogus row.  In future versions
of MySQL there may be a more direct way of doing this.

> Also, while I'm thinking of it, do I need to add INDEX(user_id)
> or is that redundant since it is the PRIMARY KEY?

Its being a primary key automatically makes it indexed.

Tim
Thread
how to start counting at a specific number?Daevid Vincent7 Apr
  • Re: how to start counting at a specific number?Thimble Smith7 Apr
  • Re: how to start counting at a specific number?Shaun Batterton8 Apr
    • Re: how to start counting at a specific number?Vivek Khera8 Apr
  • Re: how to start counting at a specific number?Shaun Batterton8 Apr
    • Re: how to start counting at a specific number?Thimble Smith8 Apr