HGDB 兼容 Oracle 中 merge into using(APP)

编程入门 行业动态 更新时间:2024-10-28 03:31:16

HGDB 兼容 <a href=https://www.elefans.com/category/jswz/34/1770041.html style=Oracle 中 merge into using(APP)"/>

HGDB 兼容 Oracle 中 merge into using(APP)

目录

环境

文档用途

详细信息

相关文档

环境

系统平台:Microsoft Windows (64-bit) 10

版本:4.3.2

详细信息

orale中的merge语句的SQL如下:

 第一条merge语句

merge into test01 a using (select 1 as id, 'xxxx' as note from dual) b on (a.id=b.id) when matched then update set a.note=b.note when not matched then insert (a.id, a.note) values (b.id, b.note);

第二条merge语句

merge into test01 a using (select 1 as id, 'yyyy' as note from dual) b on (a.id=b.id) when matched then update set a.note=b.note when not matched then insert (a.id, a.note) values (b.id, b.note);

 转换成HGDB的语法如下:

 第一条merge语句 

WITH upsert as (update test01 m set note='xxxx' where id= 1 RETURNING m.* ), data as (select 1 as id, 'xxxx' as note) insert into test01 select * from data a where not exists(select 1 from upse rt b where a.id=b.id);

更多详细信息请登录【瀚高技术支持平台】 查看瀚高技术支持平台

更多推荐

HGDB 兼容 Oracle 中 merge into using(APP)

本文发布于:2023-07-03 09:24:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1004400.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Oracle   HGDB   APP   merge

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!