Escape Characters
Escape Character Table
| Character Sequence | Represents Character |
|---|---|
\' | Single quote ' |
\" | Double quote " |
\n | Newline character |
\r | Carriage return |
\t | Tab character |
\\ | Backslash \ |
\% | % see below for rules |
\_ | _ see below for rules |
Rules for Using Escape Characters
- Identifiers contain escape characters (database names, table names, column names, aliases)
- Regular identifiers: Directly prompt an error for the identifier, because identifiers are required to be numbers, letters, and underscores, and cannot start with a number.
- Backtick `` identifiers: Keep as is, do not escape
- Data contains escape characters
- Encountering the defined escape characters will trigger escaping (
%and_see below), if there is no matching escape character, the escape symbol\will be ignored (\xremains as is). - For
%and_, since these two characters are wildcards inlike, use\%and\_in pattern matchingliketo represent the characters%and_themselves. If\%or\_are used outside thelikepattern matching context, their results are the strings\%and\_, not%and_.
- Encountering the defined escape characters will trigger escaping (