Forum Discussion
Anonymous
3 years agoNot applicable
Big query temporary table
hi, how can i use temporary tables (BQ) in sql statement: begin CREATE TEMP TABLE tmp_table as select ID,Country FROM `prod.Main.Entities` AS entities where entit...
- 3 years ago
Anonymous , Try with clause
with temp as(
CREATE TEMP TABLE tmp_table as
select ID,Country
FROM `prod.Main.Entities` AS entities
where entities.RegistrationDate >='2023-01-01';
)
select temp.D , Countries.CountryName
from tmp_table as temp
LEFT JOIN `prod.Main.Countries` AS Countries ON temp.Country = Countries.ISO2;
amitchandak
3 years agoSuper User
Anonymous , Try with clause
with temp as(
CREATE TEMP TABLE tmp_table as
select ID,Country
FROM `prod.Main.Entities` AS entities
where entities.RegistrationDate >='2023-01-01';
)
select temp.D , Countries.CountryName
from tmp_table as temp
LEFT JOIN `prod.Main.Countries` AS Countries ON temp.Country = Countries.ISO2;
Anonymous
3 years agoNot applicable
thanks!
if i need more then 1 temp table? or if i have performance issue?
is there any other option?