The short answer
A running total is a cumulative sum.
Example:
Day Sales
1 100
2 200
3 50Running total:
100
300
350SQL:
SUM(sales) OVER (
ORDER BY sale_date
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
)The important part is:
ORDER BY sale_datebecause SQL needs to know the sequence.