例えば
簡略化されたケーステーブル:
select count(1) from table_a; --> returns 5 results
select count(1) from table_b; --> returns 4 results
select count(1) from table_a, table_b2 b
where b.id_ab like a.id_ab; --> returns 4 results
select count(1) from table_a, table_b2 b
where b.id_ab not like a.id_ab; --> returns unexpected result
SQL:
これを試しましたが(例外)、エラーが発生しました。
select a.id_ab from table_a a, table_b b except select a.id_ab from table_a, table_b2 b
where b.id_ab not like a.id_ab;
またはそれを行うためにユニオンを使用する方法は?例えば
(Select * from table_a except select * from table_b) Union All (Select * from table_b except select record_id from table_a);
期待される結果:
ありがとうございました。