merge into a using b on (a.x=b.x)
when matched then update set a.b=a.b-b.b
另外我记得我用这样的方法执行有通过的,在发生一次错误后就不能能过了。怎么回事,我用的是oracle10G

解决方案 »

  1.   

    不可以,语法要求都写上,我想要求只是在满足条件下进行update操作,不满足条件什么也不做。以上的写法为什么不行。
    ========================================
    那可以使用update操作
      

  2.   

    看oracle sql reference中关于merge操作的用法
      

  3.   

    10G里面可以用WHERE:
    merge into a using b on (a.x=b.x)
    when matched then update set a.b=a.b+b.b
    when not matched then  insert values (b.x,b.b) where (1<>1);