我想从重复的字段中的大查询中获取数据

时间:2019-02-12 11:25:28

标签: google-bigquery

我想从重复的字段到重复的大查询中获取数据。我有重复的答案字段,也有一个重复的选项字段。在选项字段中,我有一个答案为否,我想在数字字段中计算该答案。
但是我遇到了一个错误:

WITH
  data AS(
  SELECT
    task.workflowInfo.answers AS ans
  FROM
    `Test_2019_02_07` ),
  data_2 AS(
  SELECT
    ans.options.answerNo AS aac
  FROM
    data 
    )
SELECT * FROM data_2   

但是出现错误:

Cannot access field options on a value with type ARRAY<STRUCT<question STRUCT<normalization STRUCT<dbInfo STRUCT<id STRING>, name STRUCT<name STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, displayName STRUCT<name STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, ...>, displayText STRUCT<name STRUCT<firstName STRING, middleNames STRING, lastName STRING>, canonicalName STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, questionNo INT64, ...>, actualAnswer STRUCT<tenScaleRatingAnswer STRING, threeScaleRatingAnswer STRING, fiveScaleRatingAnswer STRING, ...>, goodReasons ARRAY<STRUCT<normalization STRUCT<dbInfo STRUCT<id STRING>, name STRUCT<name STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, displayName STRUCT<name STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, ...>, displayText STRUCT<canonicalName STRUCT<firstName STRING, middleNames STRING, lastName STRING>>, answerNo INT64>>, ...>> at [9:9]

我如何解决此问题,请帮忙。

0 个答案:

没有答案