SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog

© 2026 SQL Playground. Built for developers.

PrivacyTermsAboutRSS Feed
SQL Playground
TutorialsPlayground
SQL FormatterSQL MinifierSyntax ValidatorJSON to SQLCSV to SQLSQL to JSONER Diagram Generator
Daily ChallengeInterviewsCheat SheetBlog
Initializing...
Chapter 6: Window Functions
6-2
Your Progress

Running Total

You can use aggregate functions like SUM() as window functions to calculate running totals.

SELECT date, amount, 
       SUM(amount) OVER (ORDER BY date) as running_total
FROM sales;

Task: Calculate the running total of sales ordered by day.

Loading...
Run a query to see results