October 18th, 1999, 05:57 PM
I want to create a table with a column which is primary key and auto increment. Now is there any way so that I can specify the starting value? (e.g. it starts from 10000)
October 19th, 1999, 07:54 AM
Insert a dummy record with the value of n-1 for the auto-increment field (instead of null) where n is the number you wish for the first record. After a legitimate record has been entered using null, you can delete the dummy record.
MySQL takes the value of the largest field and increments it. If no record exists the largest field is null which is interpreted to be 0. So the first record to be inserted would begin with 1.