The escape character _mysql recognizes the following escape sequence

Source: Internet
Author: User


The escape character. MySQL recognizes the following escape sequences

In a string, some sequences have special meanings. These sequences begin with a backslash (' \ '), the so-called escape character. MySQL recognizes the following escape sequences:

/
ASCII 0 (NUL) characters.

\‘
Single quotation mark ("').

\"
Double quotation marks (' "').

\b
Backspace

\ n
Line break.

\ r
Carriage return character.

\ t
The tab character.

\z
ASCII 26 (Control (Ctrl)-Z). The character can be encoded as ' \z ' to allow you to resolve the issue in Windows where ASCII 26 represents the end of the file. (If you try to use MySQL db_name < File_name,ascii 26 will cause problems).

\\
The backslash (' \ ') character.

\%
The '% ' character. See the annotations later in the table.

\_
The ' _ ' character. See the annotations later in the table.

These sequences are case-sensitive. For example, ' \b ' is interpreted as a backspace, but ' \b ' is interpreted as ' B '.

The ' \% ' and ' \_ ' sequences are used to search for '% ' and ' _ ' literal instances in a pattern matching environment that may be interpreted as a wildcard character. See section 12.3, 1, "string comparison function". Please note that if you use ' \% ' or ' \_ ' in other environments, they return the string ' \% ' and ' \_ ' instead of '% ' and ' _ '.

In other escape sequences, backslashes are ignored. In other words, the escape character is interpreted as if it were not escaped.

There are several ways to include quotation marks in a string:

· "" can be written in a string with the ' ' ' reference '.

· "'" can be written in a string using ' ' ' ".

· You can add an escape character (' \ ') before the quotation marks.

· Using ' ' referenced ' within a string does not require special handling and does not need to be double-character or escaped. Similarly, the use of ' ' referenced ' within a string does not require special handling.

The escape character _mysql recognizes the following escape sequence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.