json_quote
json_quoteβ
Descriptionβ
Syntaxβ
VARCHAR json_quote(VARCHAR)
Enclose json_value in double quotes ("), escape special characters contained.
exampleβ
MySQL> SELECT json_quote('null'), json_quote('"null"');
+--------------------+----------------------+
| json_quote('null') | json_quote('"null"') |
+--------------------+----------------------+
| "null" | "\"null\"" |
+--------------------+----------------------+
MySQL> SELECT json_quote('[1, 2, 3]');
+-------------------------+
| json_quote('[1, 2, 3]') |
+-------------------------+
| "[1, 2, 3]" |
+-------------------------+
MySQL> SELECT json_quote(null);
+------------------+
| json_quote(null) |
+------------------+
| NULL |
+------------------+
MySQL> select json_quote("\n\b\r\t");
+------------------------+
| json_quote('\n\b\r\t') |
+------------------------+
| "\n\b\r\t" |
+------------------------+
keywordsβ
json,quote,json_quote