At 22:34 +0100 12/27/02, Martin Skjöldebrand wrote:
Sorry for this newbie question (my MySQL-book is at work). I want my ID field to start with value 1000 and (preferably) auto-increment to 2000 is this possible to specify in my table somehow?
This question is ambiguous. Do you mean that you want a starting value of 1000, and for subsequent records to auto_increment by 1000 each time? If so, you cannot ask MySQL to do that automatically.
Or do you mean that you want the normal increment-by-one behavior, but you just want the first value to be 1000? If so, use a MyISAM table, and declare it as follows: CREATE TABLE tbl_name (column definitions here) TYPE = MyISAM AUTO_INCREMENT = 1000; The final AUTO_INCREMENT = n clause causes the first record to be assigned that value in the AUTO_INCREMENT column.
(I know auto-increment, just how do I set the starting value). What would the appropriate SQL-sentence to update the table be? Cheers, Martin S. -- Martin Skjoldebrand http://www.skjoldebrand.org
--------------------------------------------------------------------- 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