Skip to content

Instantly share code, notes, and snippets.

@MyCueCards
Last active February 13, 2019 15:06
Show Gist options
  • Save MyCueCards/d2f71fd67121f13173267480f92baa1e to your computer and use it in GitHub Desktop.
Save MyCueCards/d2f71fd67121f13173267480f92baa1e to your computer and use it in GitHub Desktop.
In Salesforce Marketing Cloud, this query finds records within the All Subscriber List. The records it finds are those emails addresses, which match the email within SomeDataExtension. There is an extra parameter to exclude a string.
SELECT sde.*
FROM SomeDataExtension sde
INNER JOIN _ListSubscribers l ON sde.SubKey = l.SubscriberKey
WHERE l.ListID = '000'
AND sde.SubKey = l.SubscriberKey
AND sde.Email = l.EmailAddress
AND sde.Email NOT LIKE '%string here%'
AND l.EmailAddress NOT LIKE '%string here%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment