如何在有效的Postgres SQL查询中编写以下内容:
with foo as (select * from ...) insert into bar select * from foo insert into baz select * from foo
如果您希望在一条语句中全部使用,则可以使用CTE:
with foo as ( select * from ... ), b as ( insert into bar select * from foo returning * ) insert into baz select * from foo;
笔记:
insert
select *
returning
update
delete