I was using Google SQL and I ran into the following challenge. For practical issues, let's assume we have the following table:
TABLE_1
| Status (string) | Values (array) |
|---|---|
| Status 1 | [a,b] |
| Status 1 | [c,d] |
| Status 1 | [e,f] |
| Status 2 | [g,h] |
| Status 2 | [i,j] |
And the desired outcome is the table_2, which should be structured as follows:
TABLE_2
| Status (string) | Values (array of arrays) |
|---|---|
| Status 1 | [[a,b],[c,d],[e,f]] |
| Status 2 | [[g,h],[i,j]] |
I have tried using array grouping functions but I didn't manage to get SQL to build arrays of arrays in the process of grouping by status. What am I missing?