Comments - JSON_OBJECTAGG
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.
How is this resulting JSON in the example what we would want? -- {"1":"Hello", "1":"World", "2":"This"} --
A more useful JSON result would be: -- {"1":["Hello","World"], "2":"This"} --
Or, if the function is expanded to take an additional third parameter JSON_OBJECTAGG(key, value,optional_keyfield_for_duplicate_values):
-- select * from t1; +------+-------+------+
+------+-------+------+
+------+-------+------+
SELECT JSON_OBJECTAGG(a, b, c) FROM t1; +---------------------------------------------+
+---------------------------------------------+
+---------------------------------------------+
--