缺少关键字USING也能成功?
sorry,上面只是手写一个例子,漏了using,但是生产上确实跑成功了,有人知道为什么吗?
merge into tbl a
using
(select col , col2
 from tbl2) b
on (a.col = '2')
when matched then update
set a.col = b.col

解决方案 »

  1.   

    缺少关键字USING也能成功?
    sorry,上面只是手写一个例子,漏了using,但是生产上确实跑成功了,有人知道为什么吗?
    merge into tbl a
    using
    (select col , col2
     from tbl2) b
    on (a.col = '2')
    when matched then update
    set a.col = b.colselect col , col2 from tbl2返回多条数据还是单条数据??
      

  2.   

    http://blog.csdn.net/yole_grise/article/details/15337973
      

  3.   

    缺少关键字USING也能成功?
    sorry,上面只是手写一个例子,漏了using,但是生产上确实跑成功了,有人知道为什么吗?
    merge into tbl a
    using
    (select col , col2
     from tbl2) b
    on (a.col = '2')
    when matched then update
    set a.col = b.colselect col , col2 from tbl2返回多条数据还是单条数据??估计就一条,不然它怎么更新