MySQL Forums
Forum List  »  Newbie

Do we have something like "UPDATE ... ON DUPLICATE KEY DELETE ..."
Posted by: Jinfeng Hu
Date: April 05, 2008 08:50PM

We have "INSERT ... ON DUPLICATE KEY UPDATE ..." which is really useful. Now I need a similar feature, "UPDATE ... ON DUPLICATE KEY DELETE ...".
More specifically, I want to update a field (claimed as "unique") of a record, if the update results in a "duplicate entry" error, then delete this record. So far, I haven't got a convenient way to do so. Does anyone have experience on this?
So many thanks!

Jinfeng

Options: ReplyQuote


Subject
Written By
Posted
Do we have something like "UPDATE ... ON DUPLICATE KEY DELETE ..."
April 05, 2008 08:50PM


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.