[步骤]
update RB_WareHouse_Product set isDullLabel = 1 where id in (select a.id FROM RB_WareHouse_Product a WITH ( NOLOCK )
INNER JOIN RB_WareHouse wh WITH ( NOLOCK ) ON a.CustomerID=wh.CustomerID AND a.WareHouseID=wh.ID AND wh.IsActive=1
LEFT JOIN RB_Warehouse_Product_ActiveInfo r WITH(NOLOCK) on a.CustomerID=r.CustomerID AND a.SKU=r.SKU AND a.WarehouseID=r.WarehouseID
where wh.WareHouseType = 1 and a.addtime is not null and a.sku is not null and a.sku != '' and (a.GoodNum > 0 or a.LockNum > 0
) and wh.ActiveDays > 0 and r.sku is not null and r.ActiveDays > 0 and wh.ActiveDays < r.ActiveDays
) and (isDullLabel = 0 or isDullLabel is null or isDullLabel = '')
[结果]
[期望]
建议先查询出来结果 然后 再更具ID 分批次更新 ,缓减阻塞