【发布时间】:2020-07-09 06:13:29
【问题描述】:
我有一个如下的数据结构:
产品
| name | region_ids |
----------------------------------
| shoe | c32, a43, x53 |
| hat | c32, f42 |
# Schema
name STRING NULLABLE
region_ids RECORD REPEATED
region_ids.value STRING NULLABLE
地区
| _id | name |
---------------------
| c32 | london |
| a43 | manchester |
| x53 | bristol |
| f42 | liverpool |
# Schema
_id STRING NULLABLE
name STRING NULLABLE
我想查找“region_ids”的数组并将它们替换为区域名称以生成如下表:
| _id | name | region_names |
----------------------------------------------
| d22 | shoe | london, manchester, bristol |
| t64 | hat | london, liverpool |
使用标准 SQL 执行此操作的最佳方法是什么?
谢谢,
一个
【问题讨论】:
-
取决于精确的 MySQL 版本。
-
大查询是标准 SQL
-
例如 - 标准 SQL 允许递归 CTE,似乎...而不是 BigQuery。或者您无论如何都不会使用 MySQL 特定的构造(或者 BQ 不支持原始 SQL)?
标签: mysql join google-bigquery record