I’m trying to do a query like the following:
DELETE FROM table
WHERE foreignKeyIdColumn = "foreignKeyIdValue"
AND (column1, column2) NOT IN (("value1", "value2"), ("value3", "value4"));
I can’t for the life of me figure out how to do it short of passing in raw SQL. The tables in question have a composite PK consisting of FKs to other tables.
New contributor
Ciara Southgate is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.