Inserting into one table data from another table in BigQuery. I'm trying to insert data into table 1 from table 2

Viewed 63
INSERT INTO 'project.dataset.table1' (column_one, column_two, column_three)
    SELECT 
        column_one,
        column_two,
        column_three
    FROM
        'project.dataset.table2'

But I keep getting this error:

Inserted row has wrong column count; Has 4, expected 3 at [6:1].

The error is in the SELECT statement.

1 Answers

You can remove single quotes and try below

INSERT INTO project.dataset.table1 (column_one, column_two, column_three) SELECT column_one, column_two, column_three FROM project.dataset.table2

Related