I need to insert some records which might have duplicates. Column to overwrite/skip is mytable.email and mytable.fooFlag should be 1.
I came up with something like this:
INSERT IGNORE INTO mytable
VALUES ('somemailaddress')
ONLY IF 'somemailaddress' DOES NOT EXIST
AND fooFlag = 1
ONLY IFto apply toINSERT (only if)or toIGNORE (only if)– ypercube Dec 7 '12 at 11:31