一般写merge的时候很大概率会遇到下面的情景:
Merge into tb_a a
using tb_b b
on(a.id=b.id and a.name="小明")
when matched then
update set
a.name=b.name
然后会提示:ORA-38104: 无法更新 ON 子句中引用的列问题。如何解决呢?如下:
Merge into tb_a a
using tb_b b
on(a.id=b.id )
when matched then
update set
a.name=b.name
where a.name = '小明'