I have a query that return something like this:
| ID | Val | | 0 | 10 | | 1 | 20 | | 2 | 30 |
But instead of that, I wa
Assuming the table name is t, you can use a query like this:
select t.id, t.val, sum(t2.val) Sum from t, t t2 where t2.id <= t.id group by t.id, t.val
(tested in Oracle)