| Example | Code |
| Select a specific date range (last 24 hours SL=Send_Log) | SL.DateSent >= DATEADD (DAY, -1, GETDATE()) |
| In a specific BU | Where JOB.AccountID IN (‘1058863’) IN (‘Add to Campaign’, ‘Resend’) |
| When accessing Synchronized DEs in a multi BU environment add ENT. | ENT.[Campaign_Salesforce] |
| To access All Subscribers | ENT._listsubscribers |
| How to obtain Journey Dataview: Journey ID Version ID | FROM _Bounce AS B LEFT JOIN _JourneyActivity AS JA ON (B.TriggererSendDefinitionObjectID = JA.JourneyActivityObjectID) LEFT JOIN _Journey AS J ON (JA.VersionID = J.VersionID) |
Use LIKE to select multiple fields in a record:

Join Logic:

Resources
| Item | Link |
| Amazing overview on SQL by Mateusz Dabrowski | https://mateuszdabrowski.pl/docs/sql/sfmc-sql-basics/ |
| SFMC Dataviews documentation | https://help.salesforce.com/s/articleView?id=sf.mc_as_data_view_sent.htm&type=5 |
| Difference between Joins | https://stackoverflow.com/questions/5706437/whats-the-difference-between-inner-join-left-join-right-join-and-full-join |