I have a table that has some duplicates. I can count the distinct records to get the Total Volume. When I try to Sum when the
CompTia Code is
B92 and run distinct is still counts the dupes.
Here is the query:
count(distinct case when a.header_comptia_cd = 'B92' then a.notif_id else NULL end) - 1 /* Don't include NULL in the count */ as B92_Sum