![]() Previous |
![]() Next |
The Boolean operator LIKE
is designed for comparing a text value to a text pattern. A text value is like another text value or pattern when corresponding characters match.
Besides literal matching, LIKE
lets you use wildcard characters to match multiple characters in a string:
An underscore (_) character in a pattern matches any single character.
A percent (%) character in a pattern matches zero or more characters in the first string.
For example, a pattern of %AT_
matches any text that contains zero or more characters, followed by the characters AT
, followed by any other single character. Both DATA
and ERRATA
return YES
when LIKE
is used to compare them with the pattern %AT_
.
The results of expressions using the LIKE operator are affected by the settings of the LIKECASE and LIKENL options.
No negation operator exists for LIKE. To accomplish negation, you must negate the entire expression. For example, the result of the following statement is NO
.
SHOW NOT ('Boston' LIKE 'Bo%')