Return the AUTO_INCREMENT id of the last row that has been inserted or updated in a table:
SELECT LAST_INSERT_ID();
Try it Yourself »
The LAST_INSERT_ID() function returns the AUTO_INCREMENT id of the last row that has been inserted or updated in a table.
LAST_INSERT_ID(
expression)
Parameter | Description |
---|---|
expression | Optional. An expression |
Works in: | From MySQL 4.0 |
---|
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!