View Single Post

   
  #3 (permalink)  
Old 02-29-2008, 01:55 PM
Jens
 
Posts: n/a
Default Re: sql query update

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.

Reply With Quote