Syntax\n------\n\nJSON_OBJECTAGG(key, value)\n\nDescription\n-----------\n\nJSON_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.\n\nThe maximum returned length in bytes is determined by the group_concat_max_len server system variable.\n\nReturns NULL in the case of an error, or if the result contains no rows.\n\nJSON_OBJECTAGG cannot currently be used as a window function.\n\nExamples\n--------\n\nSELECT * FROM t1;\n+------+-------+\n| a    | b     |\n+------+-------+\n|    1 | Hello |\n|    1 | World |\n|    2 | This  |\n+------+-------+\n\nSELECT JSON_OBJECTAGG(a, b) FROM t1;\n+----------------------------------------+\n| JSON_OBJECTAGG(a, b)                   |\n+----------------------------------------+\n| {"1":"Hello", "1":"World", "2":"This"} |\n+----------------------------------------+\n\nURL: https://mariadb.com/docs/server/reference/sql-functions/special-functions/json-functions/json_objectagg