The easiest way I can think of to do it is to create a view grouping on account and then sum from the view.
create view myview (account,max_budget) as + select account, (max(budget)) from mytable group by account select sum (max_budget) from myview There may be a more creative way to do this in a single statement. Troy ------ Original Message --------- sorry, i didnt phrase my question correctly. If i have: Account Budget 1 30 1 30 2 40 2 40 3 20 3 20 i want the sum of the distinct account budgets...IE: 30+40+20=90 so i want it to display 90 as the result. Is this doable?
|
sorry, i didnt phrase my question correctly.
If i have:
Account Budget
1 30
1 30
2 40
2
40
3
20
3
20
i want the sum of the distinct account
budgets...IE: 30+40+20=90 so i want it to display 90 as the result. Is
this doable?
|
