DELETE FROM A WHERE NOT EXISTS (SELECT * FROM B WHERE A.id = B.id) Jag har antagit att dessa kolumner heter id .