MySQL Forums
Forum List  »  Connector/Python

Re: INSERT with SELECT
Posted by: Rick James
Date: April 30, 2013 08:22PM

It's [ code ], not < code >.

SELECT LAST_INSERT_ID(); to get the AUTO_INCREMENT from the previous INSERT.
http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id

I see you have "INSERT IGNORE". See
http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
for discussion of how to get the id at the same time, if it is already in the table.

Options: ReplyQuote


Subject
Written By
Posted
April 29, 2013 01:44AM
Re: INSERT with SELECT
April 30, 2013 08:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.