I need to exclude List to whom the particular email has been sent previously from Automation Studio via SQL Activity (Data views).

select distinct s.SubscriberKey
            from _sent s
            join _job j
            on j.jobid = s.jobid
            where (j.EmailName = '@Email Name here')

Using Update operation in SQL Activity. It is giving values to my target data extension at first time.

But at next time its not working when i click on Run once.

Any Help would be much appreciated.

  • 1
    How is it not working? What is the error it is throwing?
    – 0xsegfault
    Sep 29, 2018 at 15:25

1 Answer 1


Your SQL looks correct, and from your description you say it's working the first time and you have it as Update.

On subsequent runs, an update will update any existing records in the data extension and add any new records.

If your first run was successful - say it returned 100 records and you rerun the query again, it updates 100 records - then no new records will be added. It might appear as though the SQL didn't run, but it will have.

If you want to fully test/confirm your SQL then change it to Overwrite or alternatively clear your data extension before running.

Once you have your data extension populated and you make it a sendable data extension with mapped SubscriberKey, then you should be able to apply it as an exclusion DE. You could alternatively use an exclusion script as a more advanced method of excluding.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .