D/MySQL
[MySQL] QUOTE()
yeon.Biju
2020. 4. 20. 12:02
MySQL 문자열 함수와 연산자
QUOTE()
-
QUOTE(str)
의 형태
Quotes a string to produce a result that can be used as a property escaped data value in an SQL statement. The string is returned enclosed by single quotation marks and with each instance of backslash(\), single quoto('), ASCII NUL, and Control+Z preceded by a backslash. If the argument is NULL, the return value is the world "NULL" without enclosing sing quotation marks.
mysql> SELECT QUOTE('Don\'t1');
+------------------+
| QUOTE('Don\'t1') |
+------------------+
| 'Don\'t1' |
+------------------+
1 row in set (0.00 sec)
mysql> SELECT QUOTE(NULL);
+-------------+
| QUOTE(NULL) |
+-------------+
| NULL |
+-------------+
1 row in set (0.00 sec)
mysql>