伪代码如下:
update TABLEA a, TABLEB b
set a.addr = 'aaa',
b.name = 'bbb'
from TABLEA a, TABLEB b
where a.id = b.id and a.id = 1
答案 0 :(得分:3)
您只能更新一个表格。因此,您可以将SQL更改为以下内容:
UPDATE tableA a
SET a.addr = 'aaa'
WHERE exists
(SELECT b.id
FROM tableB b
WHERE b.id = a.id)