Quantcast
Channel: Robin on Linux
Viewing all articles
Browse latest Browse all 236

The correct way to insert data from another table in BigQuery

$
0
0

Incorrect code:

WITH source1 as (
	SELECT blah FROM blah
),
source2 as (
    SELECT moreblah FROM source1
)
INSERT INTO newtable FROM source2;

Correct solution:

INSERT INTO newtable 
    WITH source1 as (
    	SELECT blah FROM blah
    ),
    source2 as (
        SELECT moreblah FROM source1
    )
    SELECT * FROM source2;

Viewing all articles
Browse latest Browse all 236

Trending Articles