Infra/DataBase

[SQL] 생성 개수 확인 minus

감마 2009. 10. 9. 16:38
select * from (

select distinct product_id A, product_id as seq
from product_inf A 
where 
A.PRODUCT_GUBUN='L'
minus
select distinct product_id as  A, SUBSTR(B.brd_seq,2, 13) as seq
from  product_inf A, brd_list1_set B
where 
SUBSTR(B.brd_seq,0,1) = 'L'
and A.product_id = SUBSTR(B.brd_seq,2, 13)