【发布时间】:2017-05-14 06:33:51
【问题描述】:
我有一个类似
的 SQL 查询with subtable as (
................
)
select *
from subtable
我想将 select 语句中的记录插入到表中。寻找类似的东西:
with subtable as (......)
insert into newtable
select *
from subtable
但是,在 Vertica 中,INSERT 不能与 WITH (CTE) 语句一起使用。
有什么解决办法吗?
感谢您的帮助
【问题讨论】:
-
您可以改用视图。
-
既然可以
insert into newtable ( ... <select/union here> ... ),为什么还要使用with子句? -
标记正确答案! @woot - 已交付!
标签: sql sql-insert common-table-expression vertica