当前位置:网站首页>MySQL batch update data
MySQL batch update data
2022-07-28 20:31:00 【Zi Feiyi】
The following sql It can be used to batch modify the data of two tables or the same table :
UPDATE table1 t1 INNER JOIN table2 t2 // t1 For the target table ,t2 For data source table
ON t1.name = t2.name // on The following is the connection condition of the two tables , Multiple conditions can be followed and、or etc.
SET t1.sex = t2.sex, // set The columns that need to be updated , Here is about t2 Tabular sex Update to t1 Tabular sex
t1.age= t2.age // Multiple columns can be updated at the same time , Separated by commas
WHERE t1.id > 1000 AND t1.id < 2000 // where The following is the scope to be updated
It is recommended to operate in the test library first when updating in batches , It is strictly forbidden to operate directly in the production environment , Do a good job of data backup , Keep in mind that ! Keep in mind that !!!
边栏推荐
- JVM (24) -- performance monitoring and tuning (5) -- Analyzing GC logs
- 最大交换[贪心思想&单调栈实现]
- [link url]
- Why is customer support important to SaaS?
- 2. Floating point number, the difference between float and double in C language and how to choose them
- Linxu 【基本指令】
- 数据挖掘(数据预处理篇)--笔记
- C language data 3 (2)
- One article makes you understand what typescript is
- Solve the problem that jupyter cannot import new packages
猜你喜欢

上海交大牵手淘宝成立媒体计算实验室:推动视频超分等关键技术发展

How to use pycharm to quickly create a flask project

Torch. NN. Linear() function

Pop up modal box

How to automatically store email attachments in SharePoint

9. Pointer of C language (5) how many bytes does the pointer variable occupy
![[C language] use function pointers to make a different calculator](/img/58/e6ba11e054d9e45ec979224ac3e4c6.png)
[C language] use function pointers to make a different calculator

LeetCode-297-二叉树的序列化与反序列化

Raspberry pie CM4 -- using metartc3.0 to integrate ffmpeg to realize webrtc push-pull streaming

Wust-ctf2021-re school match WP
随机推荐
Multi-Modal Knowledge Graph Construction and Application: A Survey
[fasttext -- Summary notes]
Windows系统下Mysql数据库定时备份
Nocturnal simulator settings agent cannot be saved
[POC - proof of concept]
DOS common commands
Raspberry pie uses the command line to configure WiFi connections
robobrowser的简单使用
5. Difference between break and continue (easy to understand version)
Solve the problem that the nocturnal simulator cannot access the Internet after setting an agent
Usage of const and assert
Raspberry pie 3b ffmpeg RTMP streaming
长轮询,iframe和sse三种web消息实时推送demo实践
Read JSON configuration file to realize data-driven testing
LeetCode_位运算_中等_260.只出现一次的数字 III
[pytorch] LSTM neural network
通配符 SSL/TLS 证书
Solve flask integration_ Error reporting in restplus
9. Pointer of C language (5) how many bytes does the pointer variable occupy
Raspberry Pie 3 connected to WiFi