首页 > 解决方案 > 如何使用 Azure Data Studio 在 postgresql 中处理临时表?

问题描述

我在 Azure 中使用 Postgresql 数据库,但是当我使用临时表时,会出现一个错误,指出它是不允许的。

示例代码是:

select * into temptable from act_hi_taskinst

错误是:

SELECT ... INTO is not allowed here

在此处输入图像描述

我也尝试了链接https://www.postgresqltutorial.com/postgresql-select-into上的通知,但我仍然有同样的错误。

有谁知道如何解决这个问题?谢谢

标签: sqlpostgresqlazure-data-studio

解决方案


如果您使用的是 Postgres,那么 Postgres 等价物是CREATE TABLE AS

create table temptable as
    select * 
    from act_hi_taskinst;

推荐阅读