I'm trying to filter a data extension where the information pulled in is equal to about any of about 1,000 customer IDs. Is there a way to mass filter a data extension based upon a single customer attribute? Could I write a query something to the effect of "Select * where CustomerID = 12345, or 123456, or 1234567?


What I would recommend is putting this list of IDs into another DE.

You then can create a query like so:

Select a.key, a.field1, a.field2
FROM [yourSourceDe] a
INNER JOIN [yourListDE] b
ON a.key = b.key

Basically what this will do is only grab the records that the 'key' exists in both places.

You can also adjust this to exclude all those in there with a slight modification:

Select a.key, a.field1, a.field2
FROM [yourSourceDe] a
LEFT JOIN [yourListDE] b
ON a.key = b.key

This will then only return the records that do not exist in your list DE - meaning all matching records are removed.

If the list is short, you can also do an 'IN':

Select key, field1, field2
FROM [yourSourceDe] 
WHERE key IN ('12345',6789',0123')

Your target DE in the query will now contained the correctly segmented records.

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.