使用 Google SQL 分组并生成数组数组
Grouping and generating an array of arrays with Google SQL
我正在使用 Google SQL 并且我 运行 进入了以下挑战。对于实际问题,假设我们有以下 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]
而期望的结果是 table_2,其结构应如下所示:
TABLE_2
Status (string)
Values (array of arrays)
Status 1
[[a,b],[c,d],[e,f]]
Status 2
[[g,h],[i,j]]
我试过使用数组分组函数,但在按状态分组的过程中,我没能SQL构建数组的数组。我错过了什么?
根据 Mikhail 的说法,BigQuery 无法做到这一点,因此我将关闭此线程。
我正在使用 Google SQL 并且我 运行 进入了以下挑战。对于实际问题,假设我们有以下 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] |
而期望的结果是 table_2,其结构应如下所示:
TABLE_2
Status (string) | Values (array of arrays) |
---|---|
Status 1 | [[a,b],[c,d],[e,f]] |
Status 2 | [[g,h],[i,j]] |
我试过使用数组分组函数,但在按状态分组的过程中,我没能SQL构建数组的数组。我错过了什么?
根据 Mikhail 的说法,BigQuery 无法做到这一点,因此我将关闭此线程。