AUTO_INCREMENT FAQ
Answers to common questions about AUTO_INCREMENT. Learn about gaps in sequences, resetting values, and behavior in different storage engines.
How do I get the last inserted auto_increment value?
SELECT LAST_INSERT_ID();What if someone else inserts before I select my id?
How do I get the next value to be inserted?
How do I change what number auto_increment starts with?
How do I renumber rows once I deleted some in the middle?
Can I do group-wise auto_increment?
How do I get the AUTO_INCREMENT value in a BEFORE INSERT trigger?
How do I assign two fields the same auto_increment value in one query?
Does the auto_increment field have to be primary key?
How does InnoDB handle AUTO_INCREMENT?
General Information To Read
Manual Notes
How to start a table with a set AUTO_INCREMENT value?
See Also
Last updated
Was this helpful?

