Previous Topic: Comparing Character Strings

Next Topic: Use Expressions and Functions

Using the ESCAPE Keyword

When the percent sign or underscore character is part of the column data you want to match, add the ESCAPE keyword to your LIKE predicate. The ESCAPE keyword prevents SQL from interpreting the percent and underscore characters in column text as wildcards. For example, to find the column containing the characters I_MS, use the following predicate:

WHERE NAME LIKE 'I#_MS' ESCAPE '#'