当前位置:网站首页>SQL assigns the field value of data table B to a column in data table a
SQL assigns the field value of data table B to a column in data table a
2022-06-26 13:12:00 【shmilyhq】
Data sheet table1 --》 Field name ,age,def,org_code,del_flag ,id
Data sheet table2 code, table1_id, own,del_flag
The code is as follows
update table2 b
left join (
select distinct name ,org_code,batch_no from table1 where del_flag = 0
) a on a.id= b.table1_id
set b.code= a.name ,b.own= a.org_code
where b.del_flag = 0 and (b.codeis null or b.ownis null);
My humble opinion ----- For reference only !
边栏推荐
- HDU 5860
- [geek challenge 2019] rce me 1
- 橋接模式(Bridge)
- Common creation and usage of singletons
- 软件测试测试常见分类有哪些?
- Basic principle and application routine of Beifu PLC rotary cutting
- [esp32-c3][rt-thread] run RT-Thread BSP minimum system based on esp32c3
- 适配器模式(Adapter)
- 倍福PLC基于NT_Shutdown实现控制器自动关机重启
- Angle de calcul POSTGIS
猜你喜欢
To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example
第01章_Linux下MySQL的安装与使用
软件测试报告应该包含的内容?面试必问
Explain C language 11 in detail (C language series)
倍福Ethercat模块网络诊断和硬件排查的基本方法
倍福PLC实现绝对值编码器原点断电保持---bias的使用
P2393 yyy loves Maths II
What should the software test report include? Interview must ask
Power Designer - Custom Comment button
Arcpy——InsertLayer()函數的使用:摻入圖層到地圖文檔裏
随机推荐
原型模式(prototype)
P5733 [deep foundation 6. example 1] automatic correction
Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
Record a phpcms9.6.3 vulnerability to use the getshell to the intranet domain control
Electron official docs series: Best Practices
mariadb学习笔记
MariaDB study notes
外观模式(Facade)
Opencv high speed download
[geek challenge 2019] rce me 1
. Net Maui performance improvement
C - Common Subsequence
Software testing - concept
微信小程序测试点总结
10秒内完成火灾预警,百度智能云助力昆明官渡打造智慧城市新标杆
别乱用 FULL_CASE 和 PARALLEL_CASE
G - Cow Bowling
QT .pri 的建立与使用
zoopeeper设置acl权限控制(只允许特定ip访问,加强安全)
IDC报告:百度智能云AI Cloud市场份额连续六次第一