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
 sum

Author  Topic 

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2010-07-04 : 21:49:00
Hi everyone,

Can you help me?

I want to sum the amount of each accounts, how can I query this?

Cust_ID Amount
0001 100.00
0001 50.00
0001 1.25
0001 2.34
0002 400.00
0002 535.00

Many thanks,


Dudz

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-07-04 : 21:54:10
SELECT Cust_ID, Sum(Amount) FROM myTable GROUP BY Cust_ID
Go to Top of Page

eem_2055
Yak Posting Veteran

69 Posts

Posted - 2010-07-04 : 22:04:07
Thanks... :)
Go to Top of Page
   

- Advertisement -