Files
doris/docs/zh-CN/sql-reference/sql-functions/json-functions/json_quote.md
Pxl 1943a5da5f [docs] fix some document error and adjust some function document location
1. move `group_concat` from string-functions to aggregate-functions.
2. add `json_array`/`json_object`/`json_quote` to sidebar file.
3. move  `json_array`/`json_object`/`json_quote`/`get_json_double`/`get_json_int`/`get_json_string` to json-functions.
4.  change `group_concat` document to uppercase
2022-02-19 11:59:55 +08:00

1.8 KiB

title, language
title language
json_quote zh-CN

json_quote

description

Syntax

VARCHAR json_quote(VARCHAR)

将json_value用双引号(")括起来,跳过其中包含的特殊转义字符

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"             |
+------------------------+

keyword

json_quote