SQL Guide : solidDB® SQL statements : Common clauses : Wildcard characters as literals
  
Wildcard characters as literals
A wildcard character may be used in one part of a string while the literal character % (percent) or underscore ( _ ) may be used in another part of the same string.
To use a wildcard character as a literal, preface the wildcard character with an escape character and specify the escape character itself as part of the query. The syntax is the following:
... LIKE <string> {ESCAPE <escape character>}
For example, the expression below uses the backslash character ( \ ) as the escape character:
LIKE ’MY\_EXPRESSION_’ ESCAPE ’\’;
The above expression matches the following:
MY_EXPRESSION1 v MY_EXPRESSIONA v MY_EXPRESSION_
The above expression does not matches the following:
MY#EXPRESSION1
Remember: As per ANSI standard, character strings must be delimited by single quotation marks.
For example:
...LIKE ’ J_N_’; -- CORRECT ...LIKE "J_N_"; --WRONG
Double quotation marks are used for delimited identifiers, not data. This is different from C and Java languages as they uses double quotation marks to delimit strings as in "C-language string" and single quotation marks 'C' to delimit single characters.
See also
Common clauses