I have a query that return something like this:
| ID | Val | | 0 | 10 | | 1 | 20 | | 2 | 30 |
But instead of that, I wa
Would something like this work for your purposes? (Warning, potentially really darned slow with the subselect).
SELECT t1.id, t1.val, (SELECT SUM(val) FROM table AS t2 WHERE t2.id <= t1.id) 'sum' FROM table AS t1 ORDER BY id ASC