原文:http://hi.baidu.com/mawf2008/item/eec8c7ad1c5be5ae29ce9da6 merge into a using bon (a.a=b.b)when matched then update xxxxxwhen not matched then insert (xxx) values(xxx); oracle使用 merge 更新或插入数据(总结) 总结下.使用merge比传统的先判断再选择插入或更新快很多.1)主要功能提供有条件地更新和插入数据到数…
这两天给新同事安排了一个工作,即做一个update 的级联更新,在实际操作中发现了一个问题.就是对于Oracle的更新的语法,大部分人尤其是学过SqlServer的人在使用oracle的时候对于oracle的更新会有许多的疑问.就此记下,以便日后查阅 update a set a.col1 = (select b.col1 from b where b.col2 = a.col2) where exists (select * from b where a.col2 = b.col2) /**o…