Running Total of Sales
Medium
Window Functions
For every sale date return the daily amount and the cumulative (running) total up to and including that date, ordered by date.
Table schema
Sales(sale_date DATE PRIMARY KEY, amount INT)Sample data
sale_date | amount
2026-01-01 | 100
2026-01-02 | 150
2026-01-03 | 50
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.