Forked from wvpv/sfmc-deduplication-with-row-number-partition.sql
Created
September 14, 2018 17:02
-
-
Save katydorjee/fb402371d01bf9a9eda236b5dbd1a9b0 to your computer and use it in GitHub Desktop.
sfmc-deduplication-with-row-number-partition.sql
This file contains 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
select | |
x.emailaddress | |
, x.subscriberkey | |
from ( | |
select | |
w.emailaddress | |
, w.subscriberkey | |
, w.insertDate | |
, row_number() over (partition by w.subscriberkey order by w.insertDate asc) ranking | |
from Welcome_Trigger w | |
) x | |
where x.ranking = 1 | |
and x.insertDate >= convert(date,getDate()-30) | |
and x.insertDate < convert(date,getDate()-29) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment