단순화 된 사례 테이블 :
SQL
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
:
이 (제외) 만 발생하는 오류를 시도했다.
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);
예상 결과 :
감사합니다.
감사를 좋아한다. 완벽하게 작동합니다. – user1872384