Jak wybrać tylko id, gdzie nie ma w kolumnie mysql
SELECT * FROM Table1 WHERE Table1.principal NOT IN (SELECT principal FROM table2)
Amused Antelope
SELECT * FROM Table1 WHERE Table1.principal NOT IN (SELECT principal FROM table2)