0

我是 oracle 8i PL/SQL 的新手,请帮助我进行 PL/SQL 简单更新,我熟悉 T-SQL,但对 PL/SQL 感到困惑。

Update a
SET a.column = null
FROM table1 a INNER JOIN table2 b ON a.fields1=b.fields1
WHERE a.fields3=[criteria]

任何帮助将不胜感激,

Rgds阿凡

4

2 回答 2

3

Oracle 不支持使用连接语法进行更新。但是你可以这样做:

update table1 a set field1 = null 
where field3 = [criteria] and 
    exists (select 1 from table2 where field1 = a.field1)
于 2012-10-02T04:40:14.593 回答
0

我知道这个问题很老,但这可能有效:

merge into table1 t
enter code hereusing (select a.IdColumnt from table1 a INNER JOIN table2 b ON a.fields1=b.fields1 WHERE a.fields3=[criteria]) u
on t.IdColumnt = u.IdColumnt
when matched then update set t.column = null;

commit;
于 2016-05-12T07:49:27.397 回答