Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 update a table by using join

Author  Topic 

shantanu88d
Starting Member

35 Posts

Posted - 2011-05-05 : 06:43:09
i have a table mobile_master with colums
model_number, model_brand, purchased_qty, available_qty

and another table alottment with coulms
model_number, model_brand, alotted_qty

I want to update master tabl by setting available_qty as purchased_qty - alotted_qty

How to achieve this ??

Lewie
Starting Member

42 Posts

Posted - 2011-05-05 : 07:14:47
Update mobile_master set
available_qty = purchased_qty - alotted_qty
FROM mobile_master join alottment on mobile_master.model_number = mobile_master.model_number
Go to Top of Page
   

- Advertisement -