merge into XX(表) b
using --(可以是某些值,可以是表)
(
例1:(select '72' as id, 'jx' as name, ‘25’ as age) a --某值
例2:sgpms.a_pay_flow a --某表
)
on (a.id = b.id)
when matchen then --当满足on的值时,
update
set b.zd1 = a.zd1
b.zd2 = a.zd2
where XXXX --修改b表字段值等于a表的
when not matchen then --当不满足on时
update set / inset () values --执行修改或者插入
——————————————————————————————————
不知道这样对不对还,先记一下
最后
以上就是天真石头最近收集整理的关于merge into using() on的全部内容,更多相关merge内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复