SELECT account, SUM(budget) from [tableName] group by account.
 
This will show you the sum of however many budget amounts for each distinct account. 
 
Account    Budget
1                $ 200
1                    300
2                    100
 
will result in:
1                $ 500
2                    100
 
If you use SUM(budget)=s the total of $ 600 will be listed underneath the individual budget subtotals.
 
        Randy Peterson
----- Original Message -----
Sent: Thursday, October 10, 2002 2:39 PM
Subject: newbie sql question

i know this is more of an sql question (and a newbie one at that) than an rbase question but im having a problem tryin to figure this out.
 
I have a table with 2 columns...1 is Account and the other is Budget.  What i need is a sum of Budget, but there are duplicate entries so i need it to sum Budget where Account is distinct.  Anyone know how to do this?
 
thanx for the help!

Reply via email to