Suppose you have a table:
select * from tblTestName Amount--- ------A 10B 20c 40D 50E 30
The following single SELECT query can be used to calculate cumulative totals:
--//////////////////////////////////////SELECT t1.Name, t1.Amount,(SELECT SUM(t2.Amount ) FROM tblTest AS t2 WHERE t2.Name <= t1.Name ) ASTotalFROM tblTest AS t1--//////////////////////////////////////Name Amount Total--- ------ -----A 10 10B 20 30c 40 70D 50 120E 30 150