|  | Posted by diablo on 11/16/05 14:34 
Hi
 i need help with formulating a query that will update the a field on one
 table depending on the values from another for example
 
 i have a cart table: cartid, buyerid, productid, quantity
 
 i have a product table: productid, quantity
 
 i want to do a:
 
 select * from cart where buyerid=x
 
 and then depending on the returned rows i want to update the product table:
 
 update product set quantity = quantity - cart.quantity where
 productid=cart.productid
 
 if you see what i mean?
 
 Any help appreciated
 
 Kal
  Navigation: [Reply to this message] |