簡體   English   中英

Bigquery - 返回具有結構特定字段的結構數組

[英]Bigquery - Return array of structs with specific fields of the struct

我在 bigquery 中有一個結構數組。 我想返回一個結構體數組,但是該數組結構體的字段比原始結構體少。

例子:

在此處輸入圖片說明

我想要相同的結果,但沒有 Skills.Id。

我試圖做這樣的事情,但

  SELECT  [(select struct(dd.Level as Level, dd.TypeId as typeid)
                  from unnest(dd.Skills) as dd  )]  as skills    
   FROM tablee dd

但得到一個例外:

Scalar subquery produced more than one element

嘗試ARRAY而不是[]

SELECT ARRAY(select struct(dd.Level as Level, dd.TypeId as typeid) 
             from unnest(tablee.Skills) as dd) as skills    
FROM tablee

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM