So I have two tables which both have a composite primary key made from two columns. I want to find the entries in the first table that do NOT exist in the second table, always keeping in mind that my primary key is composited.
I know I have to use
SELECT * FROM table1
WHERE id NOT IN (SELECT id FROM table2)
You can use a row constructor along with
SELECT * FROM table1 WHERE (id1, id2) NOT IN (SELECT id1, id2 FROM table2);