This should be relatively simple. I dug around the MySql docs and couldn't find relevant infos.
The scenario is simple. I have a table with 3 columns. All are composite unique keys, in that, all keys together must be unique to be a valid row.
How can I use DELETE NOT IN with this setup?
I tried something like:
DELETE FROM my_table WHERE (col1,col2,col3) NOT IN (val1,val2,val3), (val4,val5,val6)
As you can see, I want to match the sets of values, not necessarily the values themselves.
Thoughts?
IN
orNOT IN
must be followed by a single list. When comparing multiple columns, the items in the list are themselves parenthesized lists. So: