Menu
I have a few tables I’m joining together.
What I’m doing is counting rows from my master FROM table.
But doing a bunch of JOINS, WHERE’s GROUP to filter and find data I want to count.
Sometimes an applicable row is referenced twice in my query. How can I make it so it’s only counted **once
Almost like a distinct in my CASE or COUNT.
“`
CASE WHEN w.ColumnField = 1 THEN SUM(d.thisField) ELSE 0 END as MyCount,
COUNT(d.thisId) as MySecondCount,