当前位置:网站首页>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);
本人拙见 -----仅供参考!
边栏推荐
- Goto statement to realize shutdown applet
- Tiger DAO VC产品正式上线,Seektiger生态的有力补充
- 软件测试 - 概念篇
- 【网络是怎么连接的】第二章(下):一个网络包的接收
- 别乱用 FULL_CASE 和 PARALLEL_CASE
- 倍福PLC通过程序获取系统时间、本地时间、当前时区以及系统时间时区转换
- Xiaobai lazy special-win10-win11 one click installation version
- 国标GB28181协议EasyGBS视频平台TCP主动模式拉流异常情况修复
- 老司机总结的12条 SQL 优化方案(非常实用)
- Less than 40 lines of code to create a blocprovider
猜你喜欢

Splunk iowait 报警的解决

opencv高速下载

不到40行代码手撸一个BlocProvider

Redis learning - 01 introduction, installation and configuration
软件测试报告应该包含的内容?面试必问

NoSQL mongodb - 04 mongodb database and web service combination case
![P5733 [deep foundation 6. example 1] automatic correction](/img/34/081dbd805593a92a86c3081d6772e3.png)
P5733 [deep foundation 6. example 1] automatic correction

初识-软件测试

Word文档导出(使用固定模板)

倍福CX5130换卡对已有的授权文件转移操作
随机推荐
Detailed explanation of C const: definition and use of C constant
Redis learning - 03 transaction
ES6:迭代器
Software testing - concept
Tiger DAO VC产品正式上线,Seektiger生态的有力补充
National standard gb28181 protocol easygbs video platform TCP active mode streaming exception repair
MySQL 自定义函数时:This function has none of DETERMINISTIC, NO SQL 解决方案
openlayers 绘制动态迁徙线、曲线
Typescript learning (I) type
倍福TwinCAT3实现CSV、TXT文件读写操作
Redis learning - 01 introduction, installation and configuration
C# 结构体:定义、示例
倍福NC轴状态转移图解析
Lightflow completed the compatibility certification with "daocloud Enterprise Cloud native application cloud platform"
轻流完成与「DaoCloud Enterprise 云原生应用云平台」兼容性认证
Record a phpcms9.6.3 vulnerability to use the getshell to the intranet domain control
Source code learning: atomicinteger class code internal logic
NoSQL mongodb - 04 mongodb database and web service combination case
processing 随机生成线动画
Summary of some application research cases of UAV Remote Sensing in forest monitoring