有时候直接通过更新视图将会使得sql大大简化,但是直接更新会出现ORA-01779: cannot modify a column which maps to a non key-preserved table错误
解决方法:通过添加BYPASS_UJVC提示,示例如下:
update /*+ BYPASS_UJVC*/
(select b1.name, b1.id from (select 10001 kid from dual union select 10000 from dual) temp, b1
where b1.id = temp.kid)
set name=name||' '||id
where id=10000;