ITALIAORIANA
Technical User
Hi,
I am having trouble with a Not Exists query. I am trying to find all the CNS and NP rows in the same table that do not have corresponding PA rows. I mocked up data to test the query but the expectd results are not showing. It's not pulling anything. Any help would be greatly appreciated.
SELECT S.PDBC_PFX, S.SESE_ID, S.SPCT_EFF_DT, S.SPCT_TERM_DT, S.SPCT_SEQ_NO, S.SPCT_PSCD_LOW, S.SPCT_PSCD_HIGH, S.PRPR_MCTR_TYPE, S.SPCT_SESE_ID
FROM CMC_SPCT_SUPP_CONV WHERE S..SPCT_PSCD_LOW + S.SPCT_PSCD_HIGH = '5253'
AND S.SESE_ID ='WBOS'
AND S.PRPR_MCTR_TYPE IN ('NP','CNS')
AND NOT EXISTS
(SELET * FROM CMC_SPCT_SUPP_CONV P
WHERE P.SESE_ID = P.SESE_ID
AND P.PRPR_MCTR_TYPE ='PA')
Thanks
Deana
I am having trouble with a Not Exists query. I am trying to find all the CNS and NP rows in the same table that do not have corresponding PA rows. I mocked up data to test the query but the expectd results are not showing. It's not pulling anything. Any help would be greatly appreciated.
SELECT S.PDBC_PFX, S.SESE_ID, S.SPCT_EFF_DT, S.SPCT_TERM_DT, S.SPCT_SEQ_NO, S.SPCT_PSCD_LOW, S.SPCT_PSCD_HIGH, S.PRPR_MCTR_TYPE, S.SPCT_SESE_ID
FROM CMC_SPCT_SUPP_CONV WHERE S..SPCT_PSCD_LOW + S.SPCT_PSCD_HIGH = '5253'
AND S.SESE_ID ='WBOS'
AND S.PRPR_MCTR_TYPE IN ('NP','CNS')
AND NOT EXISTS
(SELET * FROM CMC_SPCT_SUPP_CONV P
WHERE P.SESE_ID = P.SESE_ID
AND P.PRPR_MCTR_TYPE ='PA')
Thanks
Deana