http://www.w3schools.com
A wildcard character can be used to substitute for any other character(s) in a string.
Using the SQL % Wildcard
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":
Using the SQL _ Wildcard
The following SQL statement selects all customers with a City starting with any character, followed by "erlin":
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":
Using the SQL [charlist] Wildcard
The following SQL statement selects all customers with a City starting with "b", "s", or "p":
The following SQL statement selects all customers with a City starting with "a", "b", or "c":
The following SQL statement selects all customers with a City NOT starting with "b", "s", or "p":
Example
WHERE City LIKE '[!bsp]%';
or
SELECT * FROM Customers
WHERE City NOT LIKE '[bsp]%';
Try it yourself »
'SQL' 카테고리의 다른 글
BETWEEN Operator (0) | 2015.06.07 |
---|---|
IN Operator (0) | 2015.06.07 |
LIKE Operator (0) | 2015.06.07 |
SELECT TOP (0) | 2015.06.07 |
Injection (0) | 2015.06.07 |