Files
doris/docs/zh-CN/sql-reference/sql-functions/string-functions/json_quote.md

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