I have a query that should do a column count, where 2 other columns are true. I need to read "DealerName" when "DealerName", for example, "% MINI%" and "DealerContact_Y" = 1
But I'm not sure about the syntax. This request causes an error
SELECT DealerName, count(DealerShipId) as dealersContacted, CASE WHEN DealerName LIKE "%MINI%", WHEN DealerContact_Y = 1 THEN Count(DealerContact_Y) END as Mini_contacted_yes, Campaign, DealerId FROM tblsummaryResults
Is there a way to make mutiple WHENS in a case statement?
source share