MySQL Forums
Forum List  »  Newbie

Re: Referencing other columns at INSERT
Posted by: Ramalingam Chelliah
Date: August 27, 2004 12:11AM

Hi,
Use last_insert_id() to get previous 'pid' value and add 1 to it

mysql> insert into A
(name)
VALUES
(CONCAT_WS('_','somethingfancy',LAST_INSERT_ID()+1));

Hope this helps,

Regards,
Ram.


We Learn the Most When we have to Invent

Options: ReplyQuote


Subject
Written By
Posted
Re: Referencing other columns at INSERT
August 27, 2004 12:11AM


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.