I. MySQL annotator
There are three MySQL annotators: 1 ,#... 2 ,"--... "note -- add a space 3 ,/*... */2. escape characters in MySQL/MySQLIdentify the following escape characters:
/0
One ASCII 0
(NUL) character.
/N
A newline character.
/T
A positioning character.
/R
A carriage return.
/B
A return character.
/'
A single quotation mark.
/& Quot;
A double quotation mark ("& quot.
//
A backslash.
/%
A "%" character. It is used to search for the text instance of "%" in the body. Otherwise, "%" is interpreted as a wildcard.
/_
A "_" character. It is used to search for the text instance of "_" in the body. Otherwise, "_" is interpreted as a wildcard.
Note: If you use "/%" or "/% _" in some body environments _", these will return strings "/%" and "/_" instead of "%" and "_".
★★
There are several methods to enclose quotation marks in a string:
1. Escape:
A string is referenced by a single quotation mark ('). The single quotation mark (') character in the string can be escaped by a single quotation mark.
A string is enclosed in double quotation marks"
& Quot; ". The" & quot; "character in the string can be escaped using the" & quot; "method.
At the same time, you can continue to use an escape character "/" to escape
2. Escape-free:
A string is enclosed in double quotation marks"
& Quot; ". The single quotation mark (') in this string does not need to be treated specially and does not need to be repeated or escaped.
Likewise,
A string is referenced by single quotes ('). The double quotation marks (& quot;) in this string do not need to be treated specially and do not need to be repeated or escaped.
The following SELECT statement demonstrates how quotes and escaping work:
MySQL> Select 'hello ','
& Quot; Hello & quot; ',' & quot; Hello & quot;
& Quot; ', 'hel' 'lo','/'hello ';
+ ---------- + -------------- + ------------------- + ---------- + --------- +
Hello & quot;
& Quot; hel'lo' hello
+ ---------- + -------------- + ------------------- + ---------- + --------- +
MySQL> Select & quot; Hello
& Quot;, & quot; 'hello' & quot;, & quot; 'hello' & quot ;,
& Quot; El & quot; lo & quot;, & quot;/& quot; Hello
& Quot;
+ ---------- + ----------- + ------------ + ----------- +
Hello 'hello' & quot; lo & quot; Hello
+ --------- + ----------- + ------------ + ----------- +
MySQL> Select
& Quot; this/NIS/nfour/nlines & quot ;;
+ -------------------- +
This
Is
Four
Lines
+ -------------------- +