Possible Duplicate:
MySQL query that computes partial sums
ok, the question is not clear at all so the example would be: i have a table like this:
id amount
1 1000
2 2500
3 5000
and i need to select from it the following data:
id oamount total
1 1000 1000
2 2500 3500
3 5000 8500
i tried this but it is not correct:
select *,sum(oamount) from `table`
group by id;
and i can't figure it out