not exists構文を用います。
select * from tableA where not exists ( select * from tableB where tableA.key1 = tableB.key1 and tableA.key2 = tableB.key2 );
便利ですがレコード数が多い場合インデックスをちゃんと貼らないと重くなることに注意。
not exists構文を用います。
select * from tableA where not exists ( select * from tableB where tableA.key1 = tableB.key1 and tableA.key2 = tableB.key2 );
便利ですがレコード数が多い場合インデックスをちゃんと貼らないと重くなることに注意。