아래는 실제 사용하는 쿼리와 거의 틀린게 없는 쿼리 입니다.
SELECT A, B, C, D, E
FROM TABLE1
WHERE NOT EXISTS
(
SELECT 1
FROM TABLE1, TABLE2
WHERE
TABLE1.A=TABLE2.A
AND TABLE1.B = TABLE2.B
)
이렇게 하면 TABLE1 내용중 TABLE2 에 있는 내용은 안나온다고
여기서 찾았습니다.
NOT EXISTS 가 안먹힙니다.
TABLE2 는 TABLE1 의 mirror 테이블 입니다.
TABLE1 의 내용중 TABLE2 에 없는 것만 SELECT 하려 합니다.
위 서브 쿼리 내용중 "SELECT 1" <- 이게 맞는건지요?
NOT EXISTS 에 대해서 좀 자세히 설명 부탁드립니다. (__)
|