当前位置:网站首页>oracle和mysql批量Merge对比
oracle和mysql批量Merge对比
2022-07-05 09:37:00 【51CTO】
orm框架采用mybatis,本博客介绍一下批量合并merge用oracle和mysql来做的区别,
oracle merge合并更新函数的详细介绍可以参考我以前的博客
<!-- 批量更新新增关联信息 oracle-->
<insert id="batchSaveTipsRelatedConfig" databaseId="oracle" parameterType="com.extend.tipsConfig.model.TipsRelatedModel">
MERGE INTO t_tips_config_related A1
USING(<foreach collection="relatedTipsList" item="itm" separator="union">select #{itm.seq} seq ,
#{itm.tipsSeq} tipsSeq ,
#{itm.relaSeq} relaSeq,
#{itm.tipsContent} tipsContent
from dual
</foreach>) A2
ON(A1.tips_seq = A2.tipsSeq and A1.rela_seq = A2.relaSeq)
WHEN MATCHED THEN
UPDATE SET
A1.tips_content = A2.tipsContent
WHEN NOT MATCHED THEN
INSERT(seq , tips_seq , rela_seq, tips_content)
VALUES(A2.seq , A2.tipsSeq ,A2.relaSeq, A2.tipsContent)
</insert>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
mysql方法:
<!-- 批量更新新增关联信息 mysql-->
<insert id="batchSaveTipsRelatedConfig" databaseId="mysql" parameterType="com.extend.tipsConfig.model.TipsRelatedModel">
REPLACE INTO t_tips_config_related(seq,tips_seq,rela_seq,tips_content)
VALUES<foreach collection="relatedTipsList" item="itm" separator=",">(#{itm.seq},
#{itm.tipsSeq},
#{itm.relaSeq},
#{itm.tipsContent})</foreach>
</insert>
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
边栏推荐
- What about wechat mall? 5 tips to clear your mind
- View Slide
- 使用el-upload封装得组件怎么清空已上传附件
- Roll up, break 35 - year - old Anxiety, animation Demonstration CPU recording Function call Process
- Evolution of Baidu intelligent applet patrol scheduling scheme
- What should we pay attention to when entering the community e-commerce business?
- .Net之延迟队列
- How to implement complex SQL such as distributed database sub query and join?
- 干货整理!ERP在制造业的发展趋势如何,看这一篇就够了
- Apache dolphin scheduler system architecture design
猜你喜欢
Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
Viewpager pageradapter notifydatasetchanged invalid problem
单片机原理与接口技术(ESP8266/ESP32)机器人类草稿
What should we pay attention to when entering the community e-commerce business?
Go 语言使用 MySQL 的常见故障分析和应对方法
小程序启动性能优化实践
Roll up, break through 35 year old anxiety, and animate the CPU to record the function call process
mysql安装配置以及创建数据库和表
Solve the problem of no all pattern found during Navicat activation and registration
Analysis on the wallet system architecture of Baidu trading platform
随机推荐
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
Android SQLite database encryption
Develop and implement movie recommendation applet based on wechat cloud
LeetCode 556. Next bigger element III
Gradientdrawable get a single color
【数组的中的某个属性的监听】
Unity skframework framework (24), avatar controller third person control
Node の MongoDB Driver
[JS sort according to the attributes in the object array]
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
【js 根据对象数组中的属性进行排序】
Fluent development: setting method of left and right alignment of child controls in row
从“化学家”到开发者,从甲骨文到 TDengine,我人生的两次重要抉择
正式上架!TDengine 插件入驻 Grafana 官网
MySQL does not take effect in sorting string types
Unity skframework framework (XXIII), minimap small map tool
What should we pay attention to when developing B2C websites?
How Windows bat script automatically executes sqlcipher command
移动端异构运算技术-GPU OpenCL编程(进阶篇)
Principle and performance analysis of lepton lossless compression