So, I have two data extensions and I want to calculate count in 3rd data extension in each individual column.
My DE 1 (included all Emails of customers) My DE 2 (included all Emails and Status of customers)
DE 1
DE 2
Email & Status
(Status column can have values like: Enabled, Disabled, OnHold and so on...there is a long list)
In my final 3rd DE, I am trying to do this with columns:
DE 3
Enabled_Count, Disabled_Count, OnHold_Count
(all fields are NULLABLE for testing purpose)
I want to calculate all counts in different columns and this is what I am trying:
SELECT Count(CASE WHEN c.Email IN (Select distinct Email from DE2 WHERE Status = 'Enabled') THEN 1 ELSE 0 END) AS Enabled_Count,
Count(CASE WHEN c.Email IN (Select distinct Email from DE2 WHERE Status = 'Disabled') THEN 1 ELSE 0 END) AS Disabled_Count,
Count(CASE WHEN c.Email IN (Select distinct Email from DE2 WHERE Status = 'OnHold') THEN 1 ELSE 0 END) AS OnHold_Count
FROM DE1 AS c
I am getting this error:
An error occurred while checking the query syntax. Errors: Old style JOIN (ANSI JOINs) syntax is not allowed. Please use standard syntax.