Loading lesson path
Concept visual
Start at both ends
Return the AUTO_INCREMENT id of the last row that has been inserted in a table:
SELECT LAST_INSERT_ID();The LAST_INSERT_ID() function returns the AUTO_INCREMENT id of the last row that has been inserted in a table.
LAST_INSERT_ID( expression )
Optional. An expression
From MySQL 4.0
❮ MySQL Functions