1.8 Retrieving data that contains a specific character string (LIKE predicate)
Use the LIKE predicate to retrieve data that contains a specific character string. The specification format of the LIKE predicate is as follows.
- Specification format
-
SELECT "column-name" FROM "table-name" WHERE "column-name" LIKE 'pattern-character-string'
- column name:
-
Specify the column to use for narrowing down the retrieval.
- Note
-
You can also specify expressions other than column names. For details about the syntax of the LIKE predicate, see 7.19.4 LIKE predicate.
- LIKE 'pattern-character-string':
-
Specify the pattern character string to search for. The main pattern character strings (wildcards) are the following:
-
%
This denotes any character string of zero or more characters. If you specify 'ACT%', it will match the character strings such as ACT, ACTOR, and ACTION.
-
_ (underscore)
This denotes any single character. If you specify '_I_', it will match the character strings such as BIT, HIT, and KIT.
- Note
-
-
For details about the syntax of pattern character strings, see 7.19.4 LIKE predicate.
-
You can also specify ESCAPE in the LIKE predicate. For details, see 7.19.4 LIKE predicate.
-
-