Rows on which the value in column COL1 in table TBL5 is "ABC" are specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE 'ABC'
Example 2:
In this example, rows for which the value in column COL1 in table TBL5 begins with "ABC" are
specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE 'ABC%'
Example 3:
Rows on which the value in column COL1 in table TBL5 begins with "ABC" are specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE '%ABC'
Example 4:
Rows containing "ABC" at any position in column COL1 of table TBL5 are specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE '%ABC%'
Example :5
Rows on which the value in column COL1 in table TBL5 begins with "AB" and ends with "C" are
specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE 'AB%C'
Example :6
Rows on which the value in column COL1 in table TBL5 begins with "ABC" and ends with a blank are
specified.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE 'ABC% '
Example 7:
Rows on which the value in column COL1 in table TBL5 begins with "ABC" are specified. To define the
pattern to host variable HOST1 (fixed size of 6 bytes), specify "ABC%". Use the TRIM function to
remove blanks at the end.
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE TRIM(TRAILING :HOST1)
Example 8:
Rows on which the value in column COL1 in table TBL5 begins with "ABC". To define the pattern to
variable-length host variable HOST1, specify "ABC%".
SELECT ... FROM SCM.TBL5 WHERE COL1 LIKE :HOST1
102