Last Updated: May 3, 2026
Running totals come up constantly in SQL interviews at finance, analytics, and FAANG companies. The basic SUM() OVER(ORDER BY) syntax is covered in the Window Aggregates chapter. Here we focus on the harder patterns: cumulative percentages, partitioned accumulators, resetting totals at boundaries, and tracking balances that can go negative.