The
ESCAPE
Character
If you want to search for a character that is also used as a wildcard, (such as %, _, [, or ]), you can use
an escape character. Specify a character that you know for sure doesn’t appear in the data as the es-
cape character in front of the character you are looking for, and specify the keyword ESCAPE followed
by the escape character right after the pattern. For example, to check whether a column called col1
contains an underscore, use col1 LIKE ‘%!_%’ ESCAPE ‘!’.
For the wildcards %, _, and [ you can use square brackets instead of an escape character. For ex-
ample, instead of col1 LIKE ‘%!_%’ ESCAPE ‘!’ you can use col1 LIKE ‘%[_]%’.
Do'stlaringiz bilan baham: |