Collections:
JSON_PRETTY() - Validating JSON Value
How to encode a JSON (JavaScript Object Notation) value into a pretty-printing string using the JSON_PRETTY() function?
✍: FYIcenter.com
JSON_PRETTY(json) is a MySQL built-in function that
encodes a JSON (JavaScript Object Notation) value
into a pretty-printing string.
For example:
SELECT JSON_PRETTY('["a",1,{"key1": "value1"},"5","77",{"key2":
["value3","valueX", "valueY"]},"j", "2"]');
-- +------------------------------------------------------------+
-- | JSON_PRETTY('["a",1,{"key1": "value1"},"5","77",{"key2":
["value3","valueX", "valueY"]},"j", "2"]') |
-- +------------------------------------------------------------+
[
"a",
1,
{
"key1": "value1"
},
"5",
"77",
{
"key2": [
"value3",
"valueX",
"valueY"
]
},
"j",
"2"
]
-- +------------------------------------------------------------+
Reference information of the JSON_PRETTY() function:
JSON_PRETTY(json): str Encodes a JSON (JavaScript Object Notation) value into a pretty-printing string. Arguments, return value and availability: json: Required. The JSON value to be encoded str: Return value. The pretty-printing JSON encoded string. Available since MySQL 5.7.
⇒ JSON_QUOTE() - Quoting JSON String
⇐ JSON_OVERLAPS() - Checking JSON Overlaps
2023-12-10, 1475🔥, 0💬
Popular Posts:
How To Drop a Stored Procedure in Oracle? If there is an existing stored procedure and you don't wan...
How To Set Up SQL*Plus Output Format in Oracle? If you want to practice SQL statements with SQL*Plus...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
How To List All User Names in a Database in SQL Server? If you want to see a list of all user names ...
How To Get a List of All Tables with "sys.tables" View in SQL Server? If you want to see the table y...