A LIKE pattern beginning with % can be used to find text values that end with a specified sequence of characters.
Suffix searches are useful for identifying file extensions, email domains, product codes, names, and other ending patterns.
Find email addresses ending with '@company.com'.
SELECT
Email
FROM Customers
WHERE Email LIKE '%@company.com';
Analysts can use suffix matching for email domains, account codes, product identifiers, and data-quality checks.
- % before the pattern allows preceding characters.
- The specified text must appear at the end.
- It is useful for suffix searches.
- Leading wildcards can reduce index efficiency.
- Database collation can affect text matching.
How do you find values ending with .com?
Use a pattern such as LIKE '%.com'.
What does % before a pattern mean?
It allows zero or more characters before the specified pattern.