如何创建子类别 SQL BIGQUERY 标准

How to create subcategory SQL BIGQUERY standard

如何在 Bigquery 中使用此标准 sql 创建子类别。我错过了什么?

我收到错误消息“列名称 MVA_ID 在 [2:1] 处不明确”

SELECT
MVA_ID AS MVA_ID,
ITEM_NAME AS ITEM_NAME,
PROGRAM_PMD AS PROGRAM_PMD, 
PRODUCT AS PRODUCT,
COUNTRY AS COUNTRY,
MILESTONE AS MILESTONE,
--SUBCATEGORIZATIONS Names
Category AS Category,
SubCategory AS SubCategory,
Measures AS Measures,

FROM
    --LABOR COST
    (SELECT * FROM
        (SELECT
            MVA_ID,
            ITEM_NAME,
            PROGRAM_PMD, 
            PRODUCT,
            COUNTRY,
            MILESTONE,
            "LABOR" AS Category,
            "Rate" AS SubCategory,
            SMT_IDL_RATE AS Measures,
            FROM `xxxxx`
          ) MVA
    )
 ,
    (SELECT * FROM
        (SELECT
            MVA_ID,
            ITEM_NAME,
            PROGRAM_PMD, 
            PRODUCT,
            COUNTRY,
            MILESTONE,
            "LABOR" AS Category,
            "Hours" AS SubCategory,
            SMT_LINE_TOOLING_COST AS Measures,
            FROM `xxxx`
      ) MVA
    )

我收到错误消息“列名称 MVA_ID 在 [2:1] 处不明确”

i'm getting errors "Column name MVA_ID is ambiguous at [2:1]"
... what am i missing?

很可能您打算使用 UNION ALL 而不是 CROSS JOIN(逗号是交叉连接的快捷方式)- 如果您解决了上述错误就会消失 :o)