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.
| Author |
Topic |
|
joriveek
Starting Member
33 Posts |
Posted - 2006-04-12 : 04:16:20
|
| Hi,I have two tables, I want to make update operation.Table1:Description|Quantity| Rate---------------------------Item 1 30 100Item 2 40 200Item 1 20 300---------------------------Table2:Description|Quantity| Rate---------------------------Item 1 -10 100Item 2 -15 200Item 1 -5 300----------------------------I want UPDATE should be performed on Table1.Quantity = Table1.Quantity + Table2.Quantity on the all the columns have matches for descriptions in Table 1 that exists in Table2Example:Update Table1 Set Quantity = Quantity + (select Quantity From Table2 where Table2.Quantity = Table1.Quantity)....something like this????Any help please? This is just performing update on table1 by matching DESCRIPTION field between two tables.. |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-04-12 : 04:45:00
|
| Somthing like this Update Table1 Set Quantity = Quantity + Table2.Quanitity From Table2 Where Quantity = Table2.Quantity???If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-04-12 : 04:58:18
|
| Update T1 Set Quantity = Quantity + T2.Quanitity From Table1 T1 inner join Table2 T2 on T1.Description= T2.DescriptionMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|