数组聚合-检索BigQuery中的整行数据

时间:2018-09-19 13:51:17

标签: google-bigquery

我们已使用数组聚合方法并将数据加载到BigQuery中

说明:

enter image description here

  

是否可以使用数组聚合方法检索特定值?从具有多个记录的字段中检索数据有哪些可用的方法?

查询澄清

  

我们尝试使用以下查询从特定字段中查找所有数据的值,这些字段在屏幕快照[image.png]中具有多个值,但出现错误。

示例查询

select fv,product.productSKU,product.productVariant,product.productBrand 

from dataset.tablename 
where hn=9 and product.productBrand='Politix'

1 个答案:

答案 0 :(得分:0)

您应按照以下示例使用UNNEST

#standardSQL
SELECT 
  fv,
  product.productSKU,
  product.productVariant,
  product.productBrand 
FROM `dataset.tablename`,
  UNNEST(product) product
WHERE hn=9 
AND product.productBrand='Politix'  

您还可以选中Working with Arrays in Standard SQL

相关问题