2

我有一个查询:

update (select tmp."table1" as tmpid, 
               del."table1" as  delid 
          from "table1_TMP" tmp ,
               "table1_DEL" del 
         where del."table2" = tmp."table2" and 
               del."REFSEQNO" = tmp."REFSEQNO")
   set tmpid = delid;

此查询在 oracle 中运行没有任何问题。

如何修改此查询以在 Postgresql 上运行?

4

1 回答 1

3

我认为这会做到这一点。

update "table1_TMP" tmp
set "table1" = del."table1"
from "table1_DEL" del
where del."table2" = tmp."table2" and
      del."REFSEQNO" = tmp."REFSEQNO"
于 2012-12-14T12:53:58.187 回答