数据库刷两个表数据的脚本

UPDATE aps_tailor_instruction_detail_rec o, (SELECT a.tailorAssemblyLineId,a.tailorAssemblyLineCode,a.deptId,c.name tailorAssemblyLineName,b.id productionSubPlanDetailId,a.id productionSubPlanId,a.planNumber

FROM aps_production_sub_plan a,aps_production_sub_plan_detail b,md_tailor_assembly_line c WHERE a.id=b.productionSubPlanId  AND a.tailorAssemblyLineId=c.id 

AND b.id=79751 AND a.factoryId=46 AND a.disabled=0) n

SET o.tailorAssemblyLineId = n.tailorAssemblyLineId, o.tailorAssemblyLineCode = n.tailorAssemblyLineCode,o.deptId = n.deptId,o.tailorAssemblyLineName = n.tailorAssemblyLineName,

o.productionSubPlanId=n.productionSubPlanId,o.subPlanNumber=n.planNumber,o.productionSubPlanDetailId=n.productionSubPlanDetailId

WHERE instructionNumber IN ('CZ22010136','CZ22010137','CZ22010140') AND factoryId=46 AND disabled=0 AND size='170/92A'

AND o.productionSubPlanId=5572

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容