MySQL Forums
Forum List  »  Newbie

Re: IF statement
Posted by: Roland Bouman
Date: July 31, 2005 12:54PM

If you create a unique constraint for that combo, felix's ON DUPLICATE KEY solution should work out fine.

If you dont want that, you can get away with it using multiple statements and encode it all in the where clause of you update and your inserts. Check out this thread:

http://forums.mysql.com/read.php?10,36053,36053#msg-36053

Options: ReplyQuote


Subject
Written By
Posted
July 29, 2005 12:18AM
July 29, 2005 01:22AM
July 30, 2005 02:33PM
Re: IF statement
July 31, 2005 12:54PM


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.