BigQuery WITH子句的问题

时间:2016-10-19 15:53:43

标签: google-bigquery

我正在尝试使用documentation中描述的BigQuery的WITH子句。我在运行以下查询时遇到错误:

WITH subQ1 AS (SELECT "1"),
     subQ2 AS (SELECT "2")
SELECT * FROM subQ1
UNION ALL
SELECT * FROM subQ2;

引发的错误是:

Error: Encountered " "WITH" "WITH "" at line 1, column 1. Was expecting: <EOF>

任何人都知道我做错了什么?

1 个答案:

答案 0 :(得分:2)

你应该做Enabling Standard SQL
而不是这个 - 你应该是好的!

BigQuery Legacy SQL不支持WITH