Fujitsu J2X0-1634-01EN Computer Accessories User Manual


 
Rows of four characters for which the value in column COL1 in TBL5 begins with any character
followed by "A" and ends with "BC".
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE 'A_BC'
[Figure: Example of LIKE predicate specification (using an arbitrary string specifier) ]
Escape characters
In a pattern specification in the LIKE predicate, the percent and underscore signs specify the location of the arbitrary
characters. If the percent and underscore signs themselves are to be searched, specify an escape character.
Examples of specifying the escape character follow. Figure: Example of specifying a LIKE predicate specification
using escape characters shows the characters specified in the examples.
Example 6:
In this example, rows for which the value in column COL2 in table TBL5 is "ABC%" are specified.
The character following the word "ESCAPE" is the escape character. In a character pattern, the escape character is
specified immediately before the percent or underscore sign to be searched. Any character can be specified as the
escape character.
Example 7:
In this example, rows for which the value in column COL2 in table TBL5 table is "ABC%%" are
specified.
104