当前位置:网站首页>MYSQL数据库表A数据同步到表B
MYSQL数据库表A数据同步到表B
2022-07-17 05:02:00 【小新爱编程】
目前有一个功能,需要数据库表A的数据同步到数据库表B里,目前来说除了表名不一样,字段全部都一样。
表A

表B
然后执行sql语句
INSERT QC_RSLT_EXT SELECT * FROM QC_RSLT;
然后往下顺一下逻辑 发现只是字段进行匹配上就可以进行数据同步,那么也就是自定义字段可以进行数据同步,如以下代码所示
INSERT QC_RSLT_EXT SELECT QC_NO, QCCODE, INTEGRITY, ININTEGRITY_NUM, SPRT_RULE_LV,
NOT_SPRT_RULE_NUM, ASOC_RULE_CATEGORY, ASOC_RULE_TYPE, ASOC_RULE_NUM,
ASOC_MNITSCEN, QC_DESC FROM QC_RSLT;
这样就完成了MYSQL数据库表A数据同步到数据库表B的功能。
其实这些问题细想起来并不复杂,只是一些简单的insert语句和然后把条件进行了拼接,这样就可以完成数据同步,只是一个稍微有一点点逻辑的插入语句。
边栏推荐
- 负载均衡添加ssl证书
- 银行联行号cnasp&查询(二)
- 知识图谱de构建与应用(六):知识图谱的存储、服务与质量
- Tidb performance analysis and optimization
- 一文了解定时任务
- Expected to replace deepfake? Uncover this year's super popular nerf Technology
- 项目组暑假总结02
- [TA frost wolf \u may - hundred people plan] Figure 2.5 bump mapping
- Static attributes and static methods of class in JS
- Warriors of the Visual Studio, Assemble! (warriors of visual studio, assemble!) Original 19:40:00 on July 12, 2009 label: compilation /mic
猜你喜欢

Reproduction of XOR and encryption decryption

新生任务-5
![[TA frost wolf \u may- hundred people plan] Introduction to basic rendering lighting (I)](/img/3e/6eedbb21db4730d7c40962978d93f0.png)
[TA frost wolf \u may- hundred people plan] Introduction to basic rendering lighting (I)

Tasking new aurix tc37x demo project

UE plug-in electronicnodes 5.0.0/4.23-4.27

浅聊链路追踪

Extreme video compression using the pellet toolbox

shardingsphere内核原理

TiDB 性能优化概述

HighTec 新建 AURIX TC37X demo 工程
随机推荐
Tidb performance optimization overview
Multiple connections will be maintained for each provider instance
Extreme video compression using the pellet toolbox
脱敏字段举例
加密和解密
银行联行号cnasp&查询(二)
Codeforces Round #419 (Div. 1)B - Karen and Test
知识图谱de构建与应用(五):知识推理
ThreadLocal线程安全示例及其原理
Overview of CKA core knowledge points
浅聊链路追踪
Exploration: pharmaceutical factory system network clock synchronization (NTP time synchronization server)
Mongo Db单机版的安装和快速使用
masm32写程序
Web development with fastapi
OLTP Load Performance Optimization Practice
使用循环语句制作登录程序
Static attributes and static methods of class in JS
And predicts that nerf will eventually replace deepfake
An easy-to-use network liar reporting system without encrypted version source code