> if i use NOT EXISTS then it's not returning any rows for the 2nd part. > > AND NOT exists(SELECT ABS_PGM_ID FROM F0324DB.TAMRABS_PGM where > cust_num=112805 and ABS_TYP_ID='COFM') > 4 rows selected. > You miss one predicate, it must be: AND NOT exists(SELECT null FROM F0324DB.TAMRABS_PGM P2 where cust_num=112805 and ABS_TYP_ID='COFM' and TAMRABS_PGM.ABS_PGM_ID = P2.ABS_PGM_ID) -- Best regards, Sayan Malakshinov Senior performance tuning engineer -- //www.freelists.org/webpage/oracle-l