-- find all rows in which a begins with the character "%"
SELECT a FROM tabA WHERE a LIKE '$%%' {escape '$'}
-- find all rows in which a ends with the character "_"
SELECT a FROM tabA WHERE a LIKE '%=_' {escape '='}
Note: ?
is not permitted as an escape character if the LIKE pattern is also a dynamic
parameter (?).
In some languages, a single character consists of
more than one collation unit (a 16-bit character). The escapeCharacter used
in the escape clause must be a single collation unit in order to work properly.
You
can also use the escape character sequence for LIKE without using JDBC's curly
braces; see Boolean expressions.