我正在PostgreSql 9.5.8上运行查询,以将查询结果保存到临时表中,然后选择一些行到另一个表中。
select * into temporary mytemp1 from tbl1;
insert into tbl2 (id,val)
with sub as (select id, val from mytemp1 order by id desc, val limit 5) select
* from sub;
我遇到了错误:
ERROR: could not open relation with OID 0
SQL state: XX000
似乎找不到mytemp1?
感谢您的帮助!