I have an table like this:
What i want to achive is to group it by its point_delivery_number
and the other data should be grouped into an array. The result should be like this:
point_delivery_number | data
----------------------------------------
AT2341234asdf5234452341243 | [
| { year: "2021-01...", month: "..", consumption: "..", generation: "...", self_coverage: "..." },
| { year: "2021-01...", month: "..", consumption: "..", generation: "...", self_coverage: "..." },
| ...
| ]
----------------------------------------
AT523452345sadf345 | [{ ... }]
Is this even possible with SQL?
I am using AWS Timestream database, so there are some limitations. Certain functions are not even supported. You can see what is supported:
https://docs.aws.amazon.com/timestream/latest/developerguide/reference.html