For example, suppose that the
database is set to use
a locale where the character 'z' has the same collation elements as 'xy'.
Consider the following two WHERE clauses:
- WHERE 'zcb' = 'xycb'
- WHERE 'zcb' LIKE 'xy_b'
For WHERE clause 1,
returns TRUE, because the collation elements for the entire string 'zcb' will
match the collation elements of the entire string 'xycb'.
For WHERE clause 2,
returns FALSE, because the collation element for the character 'z' does not
match the collation element for the character 'x'. In addition, when a
metacharacter such as an underscore is used with the LIKE operator, the
metacharacter counts for one character in the string value. A clause such as
WHERE 'xycb' LIKE '_cb' returns FALSE, because
'x' is compared to the metacharacter '_' and 'y' does not match 'c'.