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
 General SQL Server Forums
 New to SQL Server Programming
 further consolidation

Author  Topic 

tariq2
Posting Yak Master

125 Posts

Posted - 2010-08-19 : 08:45:26

This query:

select gbco,gbobj,SUM(totalamount) as 'Total'
from F0902
group by gbco,GBOBJ

is giving me the following:

gbco gbobj Total
22002 101101 -1593000000
01013 101101 19010.39
12004 101101 -50000

I am looking for sub-totals for each gbobj, so looking at my data output I want just one consolidated total for gbobj (not concerned with gbco)

I hope this is clear and thank you in advance

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-08-19 : 09:21:31
select gbobj,SUM(totalamount) as 'Total'
from F0902
group by GBOBJ

What else you want ?

Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page

tariq2
Posting Yak Master

125 Posts

Posted - 2010-08-19 : 09:48:41
thats fine, thank you
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-08-19 : 10:08:16
quote:
Originally posted by tariq2

thats fine, thank you



Welcome

Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page
   

- Advertisement -