Running Sum

A user variable can maintain a per-row cumulative sum of column values:

SET @total=0;
SELECT id, value, @total:=@total+value AS RunningSum
FROM tbl;

If your platform does not permit multiple queries per connection, and if you can tolerate the O(N2) inefficiency of a self-join, this does the same job:

SELECT c.id, c.value, d.RunningSum
FROM tbl c
JOIN (
  SELECT a.id, SUM(b.value) AS RunningSum
  FROM tbl a
  LEFT JOIN tbl b ON b.id <= a.id
  GROUP BY a.id
) d USING (id);