MySQL Forums
Forum List  »  Newbie

Insert explicit value on auto_increment field
Posted by: Daniel Erles
Date: May 17, 2018 07:29AM

I have defined a table with a field called ID that is auto_increment, and that is the primary key of the table. Currently the table has 30 records, whose ID values range from 1 to 30.
Now I need a record with ID = 0.

I tried:

INSERT INTO MyTable (ID, Name) VALUES (0,'something');

but it keeps inserting ID = 31.

How can I insert the record ID = 0 ?

Thanks

Options: ReplyQuote


Subject
Written By
Posted
Insert explicit value on auto_increment field
May 17, 2018 07:29AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.