mysql多表关联更新问题

mysql多表关联更新问题,第1张

按照描述这么写:

update 表名 t1

set t1.name=(

select name from 表名 t2

where t2.pid=t1.pid and t2.name is not null and rownum=1

)

where t1.name is null

update t_time t1

set t1.Bks=

(select max(t2.EndTime) from t_diaoyonglian0703 t2

where t1.TraceID=t2.TraceID and t2.Site='bks')-

(select MIN(t2.BeginTime) from t_diaoyonglian0703 t2

where t1.TraceID=t2.TraceID and t2.Site='bks')

where t1.Date='0703'


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6146343.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-16
下一篇 2023-03-16

发表评论

登录后才能评论

评论列表(0条)

保存