WITH in BigQuery

Does BigQuery support the suggestion WITH? I don't like formatting too many subqueries.

For instance:

WITH alias_1 AS (SELECT foo1 c FROM bar)
, alias_2 AS (SELECT foo2 c FROM bar a, alias_1 b WHERE b.c = a.c)
SELECT * FROM alias_2 a;
+4
source share
2 answers

Recently introduced BigQuery Standard SQL supports WITH clause

Read more about WITH clause

See also Enabling Standard SQL

+4
source

Bigqery Standard SQl supports the WITH clause. The syntax is shown below.

with table2 as (Select column1,column2 from table1)
    select column1 from table2
0
source

All Articles