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 |
|
mimic
Starting Member
18 Posts |
Posted - 2007-08-30 : 09:01:23
|
| Hi!I have the following problem.I'd like to substract two agregate fields like:select aa, (SUM(field1)-SUM(field2)) as "something" from table1 group by aaso i need a calculated value that would sumerize filed1, sumerize field2 and than substract those values for each value in field aa.Can enyone help? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-08-30 : 09:03:16
|
[code]select aa, SUM(field1), SUM(field2), SUM(field1) - SUM(field2) as [something]from table1 group by aa[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|