MySQL Tutorial/String Functions/QUOTE
Версия от 13:44, 26 мая 2010; (обсуждение)
QUOTE(NULL);
mysql>
mysql> SELECT QUOTE(NULL);
+-------------+
| QUOTE(NULL) |
+-------------+
| NULL |
+-------------+
1 row in set (0.00 sec)
mysql>
mysql>
QUOTE(str): Quote(str) produce a result that can be used as a properly escaped data value in an SQL statement
If the argument is NULL, the return value is the word "NULL" without enclosing single quotes.
mysql>
mysql>
mysql> SELECT QUOTE("Don\"t!");
+------------------+
| QUOTE("Don\"t!") |
+------------------+
| "Don\"t!" |
+------------------+
1 row in set (0.00 sec)
mysql>