SQL continuation in SFMC Subodh
SQL continuation in SFMC
What is TOP?
Think of TOP as a VIP pass.
In SQL terms:
TOP N= fetch first N records from your data set.Works with or without sorting, but sorting makes it predictable.
Source DE:
Query Activity
SELECT TOP 5 * FROM [subodh_DE]
Target DE:
SFMC SQL: Understanding the WHERE Clause – Filtering Data
The WHERE clause in Salesforce Marketing Cloud (SFMC) SQL is used to filter records based on conditions, making queries more targeted and efficient. It helps select only the necessary data rather than retrieving all records.
Query Activity
Case 1) SELECT TOP 5 * FROM [subodh_DE] WHERE PurchaseAmount >= '750'
Target DE:
Case 2) SELECT TOP 5 * FROM [subodh_DE] WHERE PurchaseAmount >= '750' ORDER BY LastPurchaseDate DESC
Case 3) SELECT TOP 5 CustomerID,FullName,PurchaseAmount,LastPurchaseDate FROM [subodh_DE] WHERE PurchaseAmount <> '750' ORDER BY LastPurchaseDate ASC
Comments
Post a Comment