MySQL Forums
Forum List  »  Newbie

Re: Do we have something like "UPDATE ... ON DUPLICATE KEY DELETE ..."
Posted by: Diego Medina
Date: April 07, 2008 08:32AM

I think that what you are looking for the is the REPLACE statement.

it works like an insert and if there is a conflict with "any" unique key, it will delete the old row and insert the new one.

you can read the manual entry for it here http://dev.mysql.com/doc/refman/5.0/en/replace.html

Diego Medina
Web Developer
http://www.fmpwizard.com

P.S. Please read this post if you are going to post code

Options: ReplyQuote


Subject
Written By
Posted
Re: Do we have something like "UPDATE ... ON DUPLICATE KEY DELETE ..."
April 07, 2008 08:32AM


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.