I want to merge JSON string in a table and sum its value after group
for Eg:-
2023, {"hen":4, "owl":3}
2023, {"crow":4, "owl":2}
2022, {"owl":6, "crow":2}
2022, {"hen":5}
2021, {"hen":2, "crow":1}
Result could be like below
2023, {"hen":4, "owl":5, "crow":4}
2022, {"hen":5, "owl":6, "crow":2}
2021, {"hen":2, "crow":1}
2
Answers
below might be an option when you don’t know json object keys beforehand.
Query results
Consider also below approach
if applied to sample data in your question – output is