Is it possible to calculate sum of json values grouped by json keys?
Mysql version is 5.7.17 on Google cloud sql.
Example_1: A short exampl
SQL for the "short example":
SELECT col1, JSON_OBJECT('key1', SUM(value1), 'key2', SUM(value2)) AS col2 FROM (SELECT col1, JSON_EXTRACT(col2, '$.key1') AS value1, JSON_EXTRACT(col2, '$.key2') AS value2 FROM tbl) subq GROUP BY col1;