【发布时间】:2020-12-16 09:08:25
【问题描述】:
我有以下查询,它在 Sybase 中有效,我需要帮助来为 Oracle 重写它。 我是 Oracle 新手。
update table1
set col1 = (select sum(col3) from table2 t2 where t2.id = t1.id and t2.col <> 'on')
from table1 t1
where t1.id > 1 and t1.col5 in (12,13) and exists
(select id from table2 t2 where t2.id = t1.id and t2.col <> 'on' and col3 > 0)
当我尝试在 Oracle 中执行时,出现缺少表达式错误
【问题讨论】:
-
查看查询,如果您只是删除
from table1 t1并为更新子句添加别名,如update table1 t1应该可以工作 -
@sujai,把它作为答案有意义吗?您可以这样做并接受您自己的答案。
-
@Sujitmohanty30 对此有任何想法stackoverflow.com/questions/63684910/…
-
@sujai:我回答并尝试解释。请检查
标签: sql oracle join sql-update