How to get the last inserted id using scope identity without using a stored procedure in Mysql?
The LAST_INSERT_ID() function will return what you are looking for. It is a built-in function, does that qualify?

I'm not sure what you mean by excluding "stored procedure"; maybe it's just wrong terminology and you wish to also exclude built-in functions?