批量更新数据.

Update BS_Storage set StoreQty = StoreQty-a.mQty  from
select NB_DisBill.companyId,goodsId,NB_DisBill.OutStoreId,OutStorePos,mQty,
NB_DisBill.billNo 
from NB_DisBill  
inner join  NB_DisBillDetail on NB_DisBill.companyId = NB_DisBillDetail.companyId 
and NB_DisBill.billNo = NB_DisBillDetail.billNo
as a  where a.companyId = BS_Storage.companyId and a.goodsId = BS_Storage.goodsId 
and a.OutStoreId = BS_Storage.StoreId and   a.OutStorePos = BS_Storage.StorePos 
and a.billNo = 'DB0706200024' and a.companyid = '002'

posted on 2007-06-13 18:22  小土泥  阅读(156)  评论(0编辑  收藏  举报

导航