[英]Sum of repeated numeric columns (array) in Bigquery
How can I get the sum of a repeated numeric column (array) in BigQuery?如何获取 BigQuery 中重复数字列(数组)的总和?
For example, from the following array:例如,来自以下数组:
SELECT [4, 5, 9] as repeated_numeric
UNION ALL SELECT [2,3];
Row![]() |
repeated_numeric![]() |
---|---|
1 ![]() |
[4, 5, 9] ![]() |
2 ![]() |
[2,3] ![]() |
I am looking for this result:我正在寻找这个结果:
| | Row |
行 | sum |
总和 | |:---: |:---: |
|:---: |:---: | |
| 1 |
1 | 18 |
18 | |
| 2 |
2 | 5 |
5 | The length of my arrays is not fixed.
我的 arrays 的长度不固定。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.