あなたがフィルタリングの結果とSELECT2を持っているので、where句を使用したい:場合
Select columnA, columnB, columnC
from table2
where columnA not in (select columnA from table1);
をtable1のcolumnAがnullの場合、内部クエリにwhere columnA is not null
を追加するか、not in
の代わりに相関not exists
クエリを使用する必要があります。ここで
はnot exists
と同じである:
Select columnA, columnB, columnC
from table2
where not exists (select * from table1 where table1.columnA = table2.columnA);
あなたが本当にワイルドカードマッチングを使用したい場合は、後者のクエリを変更:
Select columnA, columnB, columnC
from table2 t2
where not exists
(
select *
from table1 t1
where t1.columnA like '%' + t2.columnA + '%'
);
私はあなたがより良い質問をすることができると思います。 – Strawberry