I have 2 queries which give count of cases based upon a condition
Query 1:
Select count(unique c.caseid) as New_cases from caseinfo c where
(c.crtdate between TO_DATE('2024/07/08') AND TO_DATE('2024/07/11')) and c.channel is not null;
Query 2:
Select count(unique c.caseid) as Old_cases from caseinfo c where
(c.crtdate between TO_DATE('2024/07/08') AND TO_DATE('2024/07/11')) and c.channel is null;
Both the queries have just a difference of null condition at the end.How can we combine these 2 in to a single query.
Any help would be appreciated.
2
Answers
Not pretty, but pragmatic.
If you are trying to get distinct values you could use a case expression
Otherwise you could use SUM