[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: Auto increment field to start at 0
From:       Paul DuBois <paul () snake ! net>
Date:       1999-05-31 13:37:30
[Download RAW message or body]

>I am trying to get an integer auto increment field to start at 0 and it
>keeps starting at 1, any ideas.
>
>I have tried
>
>job_number int(11) DEFAULT '0' NOT NULL AUTO_INCREMENT
>
>But whenever I insert a row job_number starts at 1

AUTO_INCREMENT series values start at 1.  This cannot change without
changing the programming interface, because the last_insert_id()
function, which returns the most recently-generated AUTO_INCREMENT
value in the current session, returns 0 if no such values have yet
been generated.

--
Paul DuBois, paul@snake.net
Northern League Chronicles: http://www.snake.net/nl/

---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail mysql-thread4211@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail mysql-unsubscribe@lists.mysql.com instead.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic