- All Courses
- PostgreSQL for Developers
- SQL Essentials
- CTEs and window functions
CTEs and window functions
CTEs make a long query readable; window functions compute across related rows without collapsing them. Running totals and rankings stop being hard.
- 8m
- Intermediate

Video by Maven Analytics · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
What this lesson covers
- Break a complex query into named CTEs
- Rank and number rows within partitions
- Compute running totals and row-to-row differences
This lesson sits in SQL Essentials, part of PostgreSQL for Developers. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will:
- Break a complex query into named CTEs
- Rank and number rows within partitions
- Compute running totals and row-to-row differences
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.