For a multiple-row insert, LAST_INSERT_ID() returns the AUTO_INCREMENT key from the first of the inserted rows : AUTO_INCREMENT : Table MySQL TUTORIALS
mysql> mysql> SELECT * FROM employee; +----+------+ | id | name | +----+------+ | 1 | A | | 2 | B | | 3 | C | | 4 | D | | 5 | E | | 6 | F | +----+------+ 6 rows in set (0.02 sec)
mysql> mysql> select LAST_INSERT_ID(); +------------------+ | LAST_INSERT_ID() | +------------------+ | 1 | +------------------+ 1 row in set (0.00 sec)