Protect special characters
The following query uses the keyword ESCAPE with LIKE
or MATCHES so you can protect a special character from misinterpretation
as a wildcard symbol.
The ESCAPE keyword designates an escape character (
!
in
this example) that protects the next character so that it is interpreted
as data and not as a wildcard. In the example, the escape character
causes the middle percent sign (%) to be treated as data. By using
the ESCAPE keyword, you can search for occurrences of a percent sign
(%) in the res_descr column by using the LIKE wildcard percent
sign (%). The query retrieves the following row.