SQL更新派工单数量=任务数量的

select b.FCommitQty '任务数量',a.FQty '派工数量',a.FSourceBillNo '派工单号',b.FBillNo '任务单号',a.FStatus '派工状态' from M_Order a 
inner join AIS20171127085948.dbo.ICMO b on a.FWorkNo=b.FBillNo  where a.FQty=b.FCommitQty and a.FStatus=0



update a set fstatus=1 from M_Order a
inner join AIS20171127085948.dbo.ICMO b on a.FWorkNo=b.FBillNo where a.FQty=b.FCommitQty and a.FStatus=0

 

posted @ 2018-06-04 10:43  WhiteSpace  阅读(256)  评论(0编辑  收藏  举报