merge into table a
using
() b on a=b
when matched then
 update set k=1 , m=2 where;--这样不行么??
 
when not matched then

解决方案 »

  1.   

    实在不行就分成多个MERGE来写吧
      

  2.   

    如果条件不一样的话,把条件写到“case ... when ...”里去更新不就完了?
      

  3.   

    merge into table a
    using
    () b on a=b
    when matched then
     update set k=(case when a=1 and b=2 then 1 else k end),
                m=(case when a=2 and b=1 then 2 else m end) where...;
      
    when not matched then