If a match set is specified, this position in the search pattern can be replaced by the exact number of characters specified in the match set.
Syntax
<match set> ::= <underscore> | ? | X'1E' | <match char>
| ([< Ù
<match char> ::=
any character except %, *, X'1F', underscore, ?, X'1E', (.<match range> ::= <match element>-<match element>
(character range)<match element> ::=
any character except ) underscoreExplanation
A
LIKE predicate is used to search for character strings that have a certain pattern. Match sets can be used to specify the pattern ( pattern element).
Model table:
Finding all customers whose names consist of six letters and begin with 'P':
SELECT name, city FROM customer
WHERE name LIKE 'P?????'
NAME |
CITY |
Porter |
New York |
Peters |
Los Angeles |