Created
March 30, 2017 03:13
-
-
Save katydorjee/eb15748cab5c1eed33280b3982e67fd1 to your computer and use it in GitHub Desktop.
Get all Subscribers based on their status
This file contains hidden or 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
-- Get all Active | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb | |
LEFT JOIN _EnterpriseAttribute ea ON sb.SubscriberID=ea._SubscriberID | |
WHERE sb.Status = 'Active' | |
-- Get all Unsubscribe | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb | |
LEFT JOIN _EnterpriseAttribute ea ON sb.SubscriberID=ea._SubscriberID | |
WHERE sb.Status = 'Unsubscribe' | |
-- Get all Held | |
SELECT sb.SubscriberKey, sb.EmailAddress, sb.Status, ea.[First Name], ea.[Last Name], ea.Gender, ea.[Date of Birth], ea.Address, ea.Suburb, ea.State, ea.Postcode, sb.DateJoined | |
FROM _Subscribers sb | |
LEFT JOIN _EnterpriseAttribute ea ON sb.SubscriberID=ea._SubscriberID | |
WHERE sb.Status = 'Held' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment