아래의 두 쿼리에는 약간의 차이가 있습니다.where 절의 차이 - in 및 not
에 Query1 :
select distinct source from BUDGET where product_code in
(select distinct PRODUCT_CODE from BUDGET where PRODUCT_CODE not in
(select distinct PRODUCT_CODE from PRODUCT_MASTER)
and PRODUCT_CODE not in
(select distinct PRODUCT_CODE from CVM)
and(VERSION_ID like '17%'
or VERSION_ID like '18%')
)
질의 2 :
select distinct SOURCE from BUDGET where PRODUCT_CODE not in
(select distinct PRODUCT_CODE from PRODUCT_MASTER)
and PRODUCT_CODE not in
(select distinct PRODUCT_CODE from CVM)
and(VERSION_ID like '17%'
or VERSION_ID like '18%')
나는 제품 코드 product_master 및 CVM 모두에 포함되지 않은 제품의 소스를 원한다. 위의 2 가지 쿼리를 시도합니다. 둘 다 다른 결과 집합을 반환합니다. 누군가가 두 검색어의 차이를 파악하는 데 도움을 줄 수 있습니까?
미리 감사드립니다.