You are here: sql query update « MsSQL Server « IT news, forums, messages
sql query update

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация