Use the percent wildcard (%) when a query must find a text pattern rather than an exact value. It matches any sequence of characters, including no characters, and works with LIKE. section 7.1 section 7.1.1
Find last names beginning with S
SELECT FirstName, LastName FROM author WHERE LastName LIKE 'S%'; Read 'S%' as “S and something.” The something may contain many characters or none, so the pattern finds names that start with S. section 7.1.1
SELECT
FirstName,
LastName
FROM author
WHERE LastName LIKE 'S%';
View the complete query for matching author last names that begin with S. section 7.1.1
Place % wherever the unmatched part of the text may occur:
- Use LastName LIKE '%N' to find last names ending in N. section 7.1.1
- Use LastName LIKE 'M%N' to find last names beginning with M and ending with N. section 7.1.1
- Use LastName LIKE '%DE%' to find last names containing DE anywhere. section 7.1.1
LIKE signals that the quoted value is a pattern. Replacing LIKE with = does not perform wildcard matching. For a single unknown character, use _, which can be combined with %; wildcard support beyond these symbols varies by database system. section 7.1.1 section 7.1.2







