Alexander Obregon's Substack

Share this post

User's avatar
Alexander Obregon's Substack
Adding Running Totals and Row Numbers with SQL
SQL

Adding Running Totals and Row Numbers with SQL

Build totals and ranks without subqueries or extra joins

Alexander Obregon's avatar
Alexander Obregon
Jun 28, 2025
∙ Paid

Share this post

User's avatar
Alexander Obregon's Substack
Adding Running Totals and Row Numbers with SQL
Share
Image Source

Working with data means doing more than just pulling it from a table. Sometimes you need totals that build as you go or numbers that show the order things happened. You’ll see that in reports, charts, and anything that tracks progress over time. You don’t have to write separate queries or chain a bunch of joins to get there. Modern databases…

Keep reading with a 7-day free trial

Subscribe to Alexander Obregon's Substack to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Alexander Obregon
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share