update [products] set Stock=Stock-number WHERE products_id IN ( SELECT cb.products_id,number FROM [pay] cb INNER JOIN [products] p ON cb.products_id = p.products_id WHERE cb.situation=1)
situation=1
UPDATE x SET x.Stock = x.Stock - y.Added FROM #Product x INNER JOIN #Pay y ON x.ProductName = y.ProductName WHERE y.Situation = 1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)