MySQL Forums
Forum List  »  Newbie

Re: Adding to a Field
Posted by: David Shrewsbury
Date: August 09, 2006 02:51PM

If you have a unique key in the table, you can use INSERT ... ON DUPLICATE KEY to handle both new rows and updating of existing rows:

INSERT INTO Player1 (id, Test1) VALUES (id, '5,')
ON DUPLICATE KEY UPDATE Test1 = CONCAT(Test1, '5,');

-Dave

Options: ReplyQuote


Subject
Written By
Posted
August 09, 2006 02:32PM
Re: Adding to a Field
August 09, 2006 02:51PM
August 09, 2006 02:51PM


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.