Problems / Running Sum Window / Editorial
A running (cumulative) sum adds each row's value to the total of all preceding rows in the partition.
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
region
date
Note: With an ORDER BY clause, many SQL engines default to RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, which produces the same result here since dates are unique within each region.
ORDER BY
RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
Solve Running Sum Window yourself →