I\'m not sure what to call this besides an \"accumulated\" column.
I have a MySQL table with a column that looks like
+---+
|val|
+---+
| 1 |
| 4 |
|
Another variation (single line) can be
SELECT val, @sm := @sm + val AS sum
FROM myTable, (SELECT @sm := 0) r;
If you don't want to use variables you can use nested select however note that this query has higher complexity (lower performance) and you must set and anchor for sorting, in my example I used _rowid but any other field can do the job
SELECT x1.val, (SELECT sum(val)
FROM myTable
WHERE id <= x1._rowid)
AS sum
FROM myTable AS x1
ORDER BY _rowid;