DELETE,UPDATE与LEFT JOIN



#UPDATE:
UPDATE A SET ApproverID=NULL,ApproveDate=NULL,ApproveResult=100,CheckerID=null,CheckDate=null, IsCheck=0
FROM [SH_MaterialApplyBuyBill] A
LEFT JOIN [SH_MaterialApplyBuyBillDetail] B ON A.ID=B.[MaterialApplyBuyBillID]
WHERE A.id=125 AND @InDetailCount=0
#DELETE:
DELETE A FROM [SH_ClosingBalance] A LEFT JOIN [SH_StoreHouse] B ON A.StoreHouseID=B.ID
WHERE B.departmentID='1000'

update table1 set a.a=1
from  table1  a inner join table2 b on a.ip=b.ip