DELETE FROM A WHERE NOT EXISTS (SELECT * FROM B WHERE A.id = B.id) Eu assumi que essas colunas são chamadas de id .