How do I get a column that is the sum of all the values before of another column?
You have to do a sum in the field you want.... The query depends on the database you're using, Oracle allows you to do this:
select id, value, sum(value) as partial_sum over (order by id) from table