LAST_INSERT_ID() (with no argument) returns the first automatically generated value that was set for an AUTO_INCREMENT column by the most recently executed INSERT or UPDATE statement to affect such a column. For example, after inserting a row that generates an AUTO_INCREMENT value, you can ...