I understand how a Join is made in Snowflake but I need to temporarily save it as a table, how can it be possible make it using consola?
(For this project I can't do it with any connectors)
I understand how a Join is made in Snowflake but I need to temporarily save it as a table, how can it be possible make it using consola?
(For this project I can't do it with any connectors)
You are looking for the CREATE TABLE AS SELECT or CTAS pattern:
CREATE TABLE tmp_table AS
SELECT a.*, b.*
FROM (SELECT * FROM VALUES ('a'),('b')) a(string)
CROSS JOIN (SELECT * FROM VALUES (1),(2)) b(vals);
SELECT * FROM tmp_table;
gives:
| STRING | VALS |
|---|---|
| a | 1 |
| a | 2 |
| b | 1 |
| b | 2 |
and if you want it to be temporary for the session you might want to add TEMP
CREATE TEMP TABLE tmp_table AS