JSON_OBJECTAGG

MariaDB starting with 10.5.0

JSON_OBJECTAGG was added in MariaDB 10.5.0.

Syntax

JSON_OBJECTAGG(key, value) [over_clause]

Description

JSON_OBJECTAGG returns a JSON object containing key-value pairs. It takes two expressions that evaluate to a single value, or two column names, as arguments, the first used as a key, and the second as a value.

Returns NULL in the case of an error, or if the result contains no rows.

Can be used as a window function (by specifying the over_clause).

Examples


    

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.