【发布时间】:2018-06-12 18:28:13
【问题描述】:
我有一个像这样的数据表
start_date | end_date | string
date x | date y | apple
date x | date y | orange
date z | date y | grape
如果 start_date 和 end_date 跨行相同,我想合并字符串列。所以输出看起来像这样
start_date | end_date | string
date x | date y | apple/orange
date z | date y | grape
我正在使用 Google 大查询 SQL。任何帮助将不胜感激。 谢谢。
【问题讨论】:
-
String_Agg 或 Group_Concat (cloud.google.com/bigquery/docs/reference/standard-sql/…)
-
仅供参考:
STRING_AGG()用于 BQ 标准 SQL,GROUP_CONCAT()用于 BQ 旧版 SQL。 BigQuery 团队强烈建议使用标准方言 - cloud.google.com/bigquery/docs/reference/standard-sql/…
标签: sql google-bigquery