如何在Snowflake数据库的Temporary表中插入数据? 我已经创建了一个如下表:
CREATE TEMPORARY TABLE mydata.name as
答案 0 :(得分:0)
这里有一些例子应该有所帮助。
--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~