当前位置:网站首页>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.
边栏推荐
- Unity skframework framework (XXIII), minimap small map tool
- Charm of code language
- Design and exploration of Baidu comment Center
- Unity skframework framework (24), avatar controller third person control
- 百度智能小程序巡检调度方案演进之路
- 【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
- Baidu app's continuous integration practice based on pipeline as code
- 美图炒币半年亏了3个亿,华为被曝在俄罗斯扩招,AlphaGo的同类又刷爆一种棋,今日更多大新闻在此...
- Analysis on the wallet system architecture of Baidu trading platform
- Observation cloud and tdengine have reached in-depth cooperation to optimize the cloud experience of enterprises
猜你喜欢
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
百度智能小程序巡檢調度方案演進之路
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
Oracle combines multiple rows of data into one row of data
Dry goods sorting! How about the development trend of ERP in the manufacturing industry? It's enough to read this article
Getting started with Apache dolphin scheduler (one article is enough)
What are the advantages of the live teaching system to improve learning quickly?
SQL learning - case when then else
Understanding of smt32h7 series DMA and DMAMUX
Tdengine already supports the industrial Intel edge insight package
随机推荐
The popularity of B2B2C continues to rise. What are the benefits of enterprises doing multi-user mall system?
Tutorial on building a framework for middle office business system
【技术直播】如何用 VSCode 从 0 到 1 改写 TDengine 代码
移动端异构运算技术-GPU OpenCL编程(进阶篇)
LeetCode 496. Next larger element I
What should we pay attention to when developing B2C websites?
Data visualization platform based on template configuration
百度APP 基于Pipeline as Code的持续集成实践
Node-RED系列(二九):使用slider与chart节点来实现双折线时间序列图
小程序启动性能优化实践
盗版DALL·E成梗图之王?日产5万张图像,挤爆抱抱脸服务器,OpenAI勒令改名
Windows uses commands to run kotlin
Are databases more popular as they get older?
初识结构体
Node の MongoDB Driver
Vs code problem: the length of long lines can be configured through "editor.maxtokenizationlinelength"
解决idea调试过程中liquibase – Waiting for changelog lock….导致数据库死锁问题
Community group buying exploded overnight. How should this new model of e-commerce operate?
Apache DolphinScheduler 系统架构设计
Tdengine connector goes online Google Data Studio app store