Search code examples
google-bigquerybigquery-udf

I am not able to create temporary table in Bigquery


got below error while trying to create temporary table in Bigquery .

create or replace temporary table mss.Business.test2 as select * from mss.Business.registration

Query error: Temporary tables may not be qualified at [2:36]


Solution

  • As mentioned by @Jaytiger names are not included in the CREATE TEMP TABLE statement.

    You can create temporary table to store the results of a query as follows:

    CREATE OR REPLACE TEMP TABLE <table1> as (SELECT * FROM `<dataset>.<table2>`);
    SELECT * from <table1>
    

    You can follow this documentation for further examples on Temp tables.