Posted by Jens on 11/16/05 14:48
Hi Kal,
You sure should handle the situation that the thing you are
substracting runs out of stocks, but the query should be:
UPDATE product
SET quantity = quantity - c.quantity
FROM product p
INNER JOIN Cart c
ON p.productid=c.productid
HTH, Jens Suessmeyer.
[Back to original message]
|