【发布时间】:2014-10-28 01:04:16
【问题描述】:
我正在尝试更新 tableA 中的 columnA。 ColumnA 的新值是从 tableB ColumnB 中提取的,使用列 a 作为 ID。我正在使用以下查询,但无法更新表格。
update tableA a set columnA = (select b.columnB from tableb b where b.columnC = a.columnA)
where exists (select * from tableb b where b.columnC = a.columnA) and a.columnD = 'ABC'
对于上述查询,我收到异常“单行子查询返回多行”
update tableA a set a.columnA = b.columnB from tableb b on a.columnA = b.columnC where a.columnD = 'ABC'
对于上述查询,我收到异常“SQL 命令未正确结束”
update a set a.columnA = b.columnB from tablea a inner join tableb b on a.columnA=b.columnC where a.columnD = 'ABC'
对于上述查询,我收到异常“SQL 命令未正确结束”
【问题讨论】:
标签: oracle