Hi All,
I'm having a problem using the minus operator. Here is what I'm trying to do.
The following line of code gives me a count of 869 total records.
SELECT COUNT(*) FROM PROD.case_guideline_details
The following block of code gives me a count of 805 total records.
SELECT count(*)
FROM PROD.CASE_GUIDELINES CG,
PROD.CASE_GUIDELINE_DETAILS X
WHERE X.CG_ID = CG.CG_ID
UNION
SELECT count(*)
FROM PROD.CASE_GUIDELINE_DETAILS Y
WHERE Y.gl_id IN (select gl_id from guideline_subsections
where glss_type = 'CRM'
and gl_id in (select gl_id from guidelines
where gl_code like '4A%' OR gl_code like '4B%'
))
AND Y.SENT_ID IS NOT NULL
what I'm trying to do is take the first query minus it from the second query to get a count of 64 records.
For some reason the MINUS operator is not working. am I using it wrong ? if I can't use the minus operator in this case what should I use ?
If I'm using the minus operator in the wrong way please direct me in the right direction.
Thanks