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 |
|
BigRetina
Posting Yak Master
144 Posts |
Posted - 2003-07-10 : 07:08:17
|
| Salute..How can I display a row total in a column??for examplea select query returns the following rowsetAccountNo Balance1 Balance2 Balance3 Total--------- -------- -------- -------- -----1 100 200 300 6005 150 150 0 300How can I calculate Total???Thanks!!! |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-07-10 : 07:26:03
|
| Balance1 + Balance2 + Balance3?Unless this is a trick question... |
 |
|
|
BigRetina
Posting Yak Master
144 Posts |
Posted - 2003-07-10 : 10:05:16
|
| Sorry!I should have made it clear that Balance1, Balance2 are aggregates!!Balance1 is just an alias!!Sorry Again! |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2003-07-10 : 10:09:24
|
| That really doesn't make a difference...create table #moo (thing int null, thing2 int null)insert into #moo values (1,2)insert into #moo values (3,4)select thing, thing2 from #mooselect sum (thing), sum(thing2), sum (thing) + sum(thing2) from #moodrop table #moo-------Moo. :) |
 |
|
|
|
|
|