私はMicrosoftSQLServerを使用しており、クエリは次の形式です(table1の主キーは(A、B)です)。
Select table1.A, table1.B, table2.C, Table3.D
from table1
left outer join table2 on table1.A = table2.A
left outer join tabl3 on table1.B = table3.B
//Here comes the question
//Except (A,B) in ( select A,B from BadTable)
どうすればうまくできますか?私はsthlikeを使用して正しいキーのセットを見つけることを考えていました(SQL Server 2000を実行している以外は使用できません)
Select A,B
from table1
not exists ( select A,B from bad table)
次に、それをメインクエリと内部結合します。どう思いますか?