当前位置:网站首页>sql 将数据表b字段值赋值到数据表a中某一列
sql 将数据表b字段值赋值到数据表a中某一列
2022-06-26 12:39:00 【shmilyhq】
数据表table1 --》 字段 name ,age,def,org_code,del_flag ,id
数据表table2 code, table1_id, own,del_flag
代码如下
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);
本人拙见 -----仅供参考!
边栏推荐
- Verilog中的系统任务(显示/打印类)--$display, $write,$strobe,$monitor
- Configuring Apache digest authentication
- Splunk iowait 报警的解决
- .NET MAUI 性能提升
- Adobe Acrobat prevents 30 security software from viewing PDF files or there are security risks
- Tiger DAO VC产品正式上线,Seektiger生态的有力补充
- File remote synchronization and backup artifact Rsync
- NLP-D60-nlp比赛D29
- Learning Processing Zoog
- 面试题积累
猜你喜欢

P2393 yyy loves Maths II

Tiger Dao VC products are officially launched, a powerful supplement to seektiger ecology

倍福TwinCAT3 NCI在NC轴界面中的基本配置和测试

NoSQL mongodb - 02 mongodb server installation, mongodb shell, basic concepts and visualization tools

第十章 设置结构化日志记录(二)

This function has none of deterministic, no SQL solution

Several methods added to the ES6 array (foreach, filter, some, every. Includes, reduce)

Verilog中的系统任务(显示/打印类)--$display, $write,$strobe,$monitor
![[BSidesCF 2019]Kookie 1](/img/22/585d081668e67b8389a1b90aaebe9d.png)
[BSidesCF 2019]Kookie 1

机组实践实验8——使用CMStudio设计基于基本模型机微程序指令(1)
随机推荐
Tiger DAO VC产品正式上线,Seektiger生态的有力补充
无人机遥感在森林监测的部分应用研究案例总结
不到40行代码手撸一个BlocProvider
[geek challenge 2019] rce me 1
软件测试 - 基础篇
Angle de calcul POSTGIS
[BSidesCF 2019]Kookie 1
机器学习笔记 - 时间序列的季节性
详细讲解C语言11(C语言系列)
[BSidesCF 2019]Kookie 1
C structure: definition and example
Lightflow completed the compatibility certification with "daocloud Enterprise Cloud native application cloud platform"
Biff TwinCAT can quickly detect the physical connection and EtherCAT network through emergency scan
Goto statement to realize shutdown applet
P5733 【深基6.例1】自动修正
ES6模块
黑马笔记---常用API
倍福PLC选型--如何看电机是多圈绝对值还是单圈绝对值编码器
P2393 yyy loves Maths II
C# const详解:C#常量的定义和使用