如何将数据插入到雪花数据库中的临时表中.我创建了一个DDL:创建临时表table_name为选择



如何将数据插入雪花数据库中的临时表中? 我已经创建了一个如下所示的表:

CREATE TEMPORARY TABLE mydata.name as

这里有一些应该有帮助的例子。

--create a seed table
CREATE TABLE t1 (id NUMBER, str VARCHAR(100)); 
--add records to seed table
INSERT into t1 values (1, 'Rich'), (2, 'Murnane'); 
--this creates the temp table and adds the two records
CREATE TEMPORARY TABLE t2 AS SELECT id, str FROM t1; 
--this adds additional records, with slightly different data
INSERT INTO t2 SELECT -1 * id, '~'||str||'~' FROM t1; 
--this will show you your four records
SELECT * FROM t2;
ID  STR
1   Rich
2   Murnane
-1  ~Rich~
-2  ~Murnane~

最新更新