我尝试执行类似
的操作CREATE TEMP TABLE tblname AS (
INSERT INTO tbl2 FROM SELECT(1,1) RETURNING a,b
);
但是我有错误:语法错误在“INSERT”或附近;
是否可以将 CREATE TABLE AS SELECT 和 INSERT FROM SELECT RETURNING 条款结合起来?
答案 0 :(得分:9)
create temp table tblname as
with i as (
insert into tbl2 (a, b)
select 1, 1
returning a,b
)
select a, b
from i