学无先后,达者为师

网站首页 编程语言 正文

ORACLE存在就修改 不存在就新增(注意更新和新增语法不同于常规语法)

作者:听风又看雨 更新时间: 2023-10-14 编程语言
MERGE into k_mingd_ncc_log t1
        USING (select #{pkName} as pkName from dual) t2
        ON (t1.pkName=t2.pkName)
        when matched then
        update set t1.code=#{code},t1.ResultMsg=#{ResultMsg},
        t1.RequestBody=#{RequestBody},t1.lastTime=#{lastTime}
        where t1.pkName=t2.pkName
        when not matched then
        insert (
		pkName,
		code,
		ResultMsg,
		RequestBody,
		taskName,
		lastTime) values (
		#{pkName},
		#{code},
		#{ResultMsg},
		#{RequestBody},
		#{taskName},
		#{lastTime}
		)

原文链接:https://blog.csdn.net/csh_on_route/article/details/122948295

  • 上一篇:没有了
  • 下一篇:没有了
栏目分类
最近更新