In a SQL notebook, I have created a bunch of view tables which involves merging/joining to ultimately create one combined/merged table. I don't want to keep all of these intermediate tables in the database, is there a way to assign a variable to these intermediate view tables (table 1,table2, etc.) I created? Given example with "Combined_table" as the final output:
CREATE or REPLACE VIEW database.table1 as select ... from...left join on...;
CREATE or REPLACE VIEW database.table2 as select ...from database.table1...left join on...;
CREATE or REPLACE VIEW database.table3 as select ...from database.table1...left join on...;
CREATE or REPLACE VIEW database.Combined_table as select table2.field1 table2.field2 table3.field1 from database.table4 left join table2 on... left join table3 on...
Hopefully you get the idea. Is there a more efficient way to do this/pass a variable to the intermediate tables?