 |
MySQL :: MySQL 5.0 Reference Manual :: 13.2.5.1 INSERT ... SELECT Syntax
Having the same problem mentioned above (last_insert_id() returns "0"), I found this solution. You can use the following select statement: SELECT id FROM mytable WHERE id IS NULL; "id" has to be an auto_increment column to make it work. It will return the
dev.mysql.com |
 |