Last active
May 1, 2018 18:05
-
-
Save garek007/de2d0c06983c99d8262f3fe92a6bc5a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT s.JobID, s.EmailName, s.EmailSubject, count(o.SubscriberKey) as TotalOpens, count(case when isUnique = 1 then 1 else null end) as UniqueOpens | |
FROM _Open o | |
JOIN ( | |
select JobID, EmailName, EmailSubject | |
from _Job | |
where EmailName NOT LIKE '%[_]welcome[_]%' | |
and (EmailName LIKE 'Newsletter[_]%') | |
AND DeliveredTime >= DATEADD(mm,DATEDIFF(mm,0,GETDATE())-1,0) | |
AND DeliveredTime < DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0) | |
and SuppressTracking = 0 | |
and AccountUserID not in (7232964) | |
)s | |
on o.JobID = s.JobID | |
group by s.JobID,s.EmailName,s.EmailSubject | |
having count(o.SubscriberKey) > 165 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment