I want to exclude subscribers who have not ‘opened’ or ‘clicked’ email in last 6 months. I have the below sql query. Is this SQL query correct? Does the final results of this sql query results have only email-addresses that have not engaged?
select email from All_Active_Subscribers where email not in ( select EmailAddress from _Subscribers s left join _Click c on c.subscriberId = s.subscriberId and c.EventDate > dateadd(dd,-180,getdate()) left join _Open o on o.subscriberId = s.subscriberId and o.EventDate > dateadd(dd,-180,getdate()) and c.subscriberId is not null or o.subscriberId is not null ) group by email