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 |
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-03-16 : 17:20:48
|
| I want to use the following select query, is it possible to show the sum of both fields: (award_amt + amount).select award_Amt, (select sum(amount) from TAB_CostDet where TaskID = 4 and EstimateType ='Final' and Chgexec = 1) from TAB_Tasks where TaskID=4Thank you very much for the helpful info. |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2011-03-16 : 17:31:03
|
| select inquery can have multiple rows, for that reason using sum(amount), the first field awardAmt just 1 row. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-03-18 : 03:45:47
|
| select award_Amt,amount,award_Amt+amount as total from(select award_Amt, (select sum(amount) from TAB_CostDet where TaskID = 4 and EstimateType ='Final' and Chgexec = 1) as amount from TAB_Tasks where TaskID=4) as tMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|