SQL Getting a running total


Example

Given this data:

dateamount
2016-03-12200
2016-03-11-50
2016-03-14100
2016-03-15100
2016-03-10-250
SELECT date, amount, SUM(amount) OVER (ORDER BY date ASC) AS running
FROM operations
ORDER BY date ASC

will give you

dateamountrunning
2016-03-10-250-250
2016-03-11-50-300
2016-03-12200-100
2016-03-141000
2016-03-15100-100