A wildcard character is used to substitute one or more characters in a string.
Wildcard characters are used with the LIKE operator. The LIKE operator is used in a WHERE clause to search for a specified pattern in a column.
The wildcards can also be used in combinations!
Here are some examples showing different LIKE operators with '%' and '_' wildcards:
The table below shows the complete "Customers" table from the Northwind sample database:
The following SQL statement selects all customers with a City starting with "ber":
The following SQL statement selects all customers with a City containing the pattern "es":
The following SQL statement selects all customers with a City starting with any character, followed by "ondon":
The following SQL statement selects all customers with a City starting with "L", followed by any character, followed by "n", followed by any character, followed by "on":