您的位置:首页 > 数据库 > Oracle

子工单开工完工日期与母工单同步 Oracle SQL

2020-06-06 07:42 946 查看

转载请注明出处,联系我: t39q@163.com
本人热衷于数据库技术及算法的研究,志同道合之士, 欢迎探讨

update sfb_file t1 set(sfb13,sfb15)=(select sfb13,sfb15 from sfb_file t2 where t1.sfb86=t2.sfb01)
where t1.sfb01 in(select sfb01
from ( select sfb_file.sfb01,sfb_file.sfb04,sfb_file.sfb13,sfb_file.sfb15
,sfb_file.sfb86,a1.sfb13,a1.sfb15,a1.sfb04
from sfb_file,( select sfb01,sfb04,sfb13,sfb15 from sfb_file
where (substr(sfb01,2,3)='510' or substr(sfb01,2,3)='516') and sfb04<>8) a1
where substr(sfb_file.sfb01,2,3)='512' and sfb_file.sfb04<>8
and sfb_file.sfb86=a1.sfb01 and (sfb_file.sfb13<>a1.sfb13 or sfb_file.sfb15<>a1.sfb15)));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: