12.18.2 Functions That Create JSON Values创建JSON值的函数

The functions listed in this section compose JSON values from component elements.本节中列出的函数从组件元素组成JSON值。

You can also obtain JSON values by casting values of other types to the JSON type using CAST(value AS JSON); see Converting between JSON and non-JSON values, for more information.您还可以通过使用CAST(value AS JSON)将其他类型的值强制转换为JSON类型来获取JSON值;有关更多信息,请参阅在JSON和非JSON值之间转换

Two aggregate functions generating JSON values are available. 有两个生成JSON值的聚合函数可用。JSON_ARRAYAGG() returns a result set as a single JSON array, and JSON_OBJECTAGG() returns a result set as a single JSON object. JSON_ARRAYAGG()将结果集作为单个JSON数组返回,JSON_OBJECTAGG()将结果集作为单个JSON对象返回。For more information, see Section 12.20, “Aggregate Functions”.有关更多信息,请参阅第12.20节,“聚合函数”