I'm looking to find all email addresses in our database where the email address domain is included in one of our domain exclusion data extension.

I thought of using something like the below, but it isn't feasible given we have over 3k domains that are part of our domain exclusion data extension.

SELECT * FROM [mytable]
  WHERE Email_Address LIKE 'domain1'
  OR Email_Address LIKE 'domain2'
  OR Email_Address LIKE 'domain3'

Is this even possible in SFMC and if so, what supporting documentation exists?


You could accomplish something like this by joining the _subscribers data view with the domain exclusions table on the users email address domain in order to find matches between the two.

To identify a user's domain with SQL, you can use this snippet:

RIGHT(EmailAddress, LEN(EmailAddress) - CHARINDEX('@', EmailAddress))

The rest of the query should be as simple as an inner join.

  • in the _subscribers dataview there is already a domain filed that can be leveraged – EazyE Jun 2 '19 at 15:40
  • Yep, that should make it easier but he'll still need to find the domain on the exclusions table as well to join them (which is why I included the above snippet). – Jason Hanshaw Jun 3 '19 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.