Here what you are looking for !!!
select LAST_INSERT_ID()
This is the best alternative of SCOPE_IDENTITY()
function being used in SQL Server
.
You also need to keep in mind that this will only work if Last_INSERT_ID()
is fired following by your Insert
query.
That is the query returns the id inserted in the schema. You can not get specific table's last inserted id.
For more details please go through the link The equivalent of SQLServer function SCOPE_IDENTITY() in mySQL?