Skip to main content

Posts

Showing posts from April, 2026

Use Cases: % Like Operator - Pattern Matching || Not/Exclusion Logic

 %(LIKE OPERATOR) - Use Cases % is used for pattern matching (Partial Text Search) Source DE: 1. Find Gmail Users:  SQL Query: Select * From [Source DE_Like Operator] Where EmailAddress LIKE '%@gmail.com' Target DE: 2. Users whose name starts with 'A' SQL Query:  Select * From [Source DE_Like Operator] Where FirstName LIKE 'A%' Target DE: 3. Users whose name ends with 'Kumar' SQL Query: Select * From [Source DE_Like Operator] Where LastName Like '%Kumar' Target DE: 4. Find users with 'Sale' in email (Campaing Filtering) SQL Query: Select * From [Source DE_Like Operator] Where Emailaddress LIKE '%Sale%' Target DE: 5. Find customers with cities contacining "Pur" SQL Query: Select * From [Source DE_Like Operator] Where City LIKE '%pur%'  Target DE: 6. Target users with mobile number starting with "9" SQL Query: Select * From [Source DE_Like Operator] Where PhoneNumber LIKE '9%'  Target DE: 7. Filte...

Using _ for Single Character Matching in SFMC SQL LIKE Operator

  🔹 The _ wildcard in SFMC SQL matches exactly ONE character. Unlike % , which matches multiple characters, _ only replaces a single character. It’s useful when you need to find values of a fixed format or specific character positions . 1. _ in Fixed-Length Patterns: _ ensures only one character is replaced at a time. Since my Source DE did not have two character I used 4 character (Pune: P___) 2. _ in Email Pattern Matching: You can use _ to detect formatting errors in emails. %@% ensures that "@" appears somewhere in the email . Question: When I use this filter, it takes all the email address from the source DE so is it not working? If I use __@gmail.com, it takes only the @gmail.com to target DE but the _ does not define the number of letters before @ 3. _ in Phone Number Validation '___-___-____' → Ensures that the phone number follows the exact format of 3-3-4 digits . It excludes numbers that are too short, too long, or missing dashes . Since th...

2.3 WHERE Clause: Filtering Data / Wildcards % & _

Using Comparison Operators in the WHERE Clause ✅ Available Operators: Operator Meaning Example = Equal to WHERE Status = 'Active' != or <> Not equal to WHERE Country != 'India' < Less than WHERE Age < 30 > Greater than WHERE Purchases > 5 <= Less than or equal to WHERE Discount <= 20 >= Greater than or equal to WHERE Revenue >= 1000 Example 1: Filter All Male from the Source DE (Where Gender = 'Male') Target DE: From the Source DE (Where Region != 'North'/ Where Region <> 'North') Result of Where Region != 'North' - Target DE Ran Both Activities in the same Workflow: Logical Operators: AND , OR , NOT AND: WHERE Region= 'North' AND Gender= 'Female' Target DE with No Records with the selected Clause: OR: Where Region = 'East' Or Gender = 'Female' Target DE: Wildcards: Pattern Matching with LIKE (%, _) '%': Where EmailAddress like '%gmail.com' Records wit...