Like Predicate - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

FROM invent.partloc);
PARTNUM
-------
186
--- 1 row(s) selected.
Find those items (and their suppliers) in PARTS that have a supplier in the PARTSUPP table:
SELECT P.partnum, P.partdesc, S.suppnum, S.suppname
FROM sales.parts P,
invent.supplier S
WHERE P.partnum, S.suppnum IN
(SELECT partnum, suppnum
FROM invent.partsupp);
Find those employees in EMPLOYEE whose last name and job code match the list of last
names and job codes:
SELECT empnum, last_name, first_name
FROM persnl.employee
WHERE (last_name, jobcode) IN
(VALUES ('CLARK', 500), ('GREEN', 200));

LIKE Predicate

The LIKE predicate searches for character strings that match a pattern.
Syntax
match-value [NOT] LIKE pattern [ESCAPE esc-char-expression]
match-value
is a character value expression that specifies a set of strings to search for that match the
pattern.
pattern
is a character value expression that specifies the pattern string for the search.
esc-char-expression
is a character value expression that must evaluate to a single character. The escape character
value is used to turn off the special meaning of percent (%) and underscore (_). See
Characters" (page 295)
See
"Character Value Expressions" (page
Considerations
Comparing the Value to the Pattern
The values that you compare must be character strings. Lowercase and uppercase letters are not
equivalent. To make lowercase letters match uppercase letters, use the UPSHIFT function. A
blank is compared in the same way as any other character.
When a LIKE Predicate Is True
When you refer to a column, the LIKE predicate is true if the pattern matches the column value.
If the value of the column reference is null, the LIKE predicate evaluates to unknown for that
row. If the values that you compare are both empty strings (that is, strings of zero length), the
LIKE predicate is true.
294
SQL Language Elements
PARTDESC
------------------
186 MegaByte Disk
and
"Escape Characters" (page
295).
255).
"Wild-Card

Advertisement

Table of Contents
loading

Table of Contents