AUTO_INCREMENT « Table « MySQL Tutorial






4.18.AUTO_INCREMENT
4.18.1.Use Auto_increment column as part of the key
4.18.2.To start with an AUTO_INCREMENT value other than 1
4.18.3.You can retrieve the most recent AUTO_INCREMENT value with the LAST_INSERT_ID().
4.18.4.For a multiple-row insert, LAST_INSERT_ID() returns the AUTO_INCREMENT key from the first of the inserted rows