liveBook · Manning

Window frame

A window frame is the set of rows positioned relative to the current row over which a window function is evaluated.

How 2 Manning books explain it

Just Use Postgres!

A window frame is the ordered subset of rows within a window partition that contributes to a window-function calculation for a row.

How it is used
Calculates running totals by progressively including ordered rows within each partition.
How deep it goes
Explains partitions, ordering, frame contents, and resulting totals, but does not cover explicit frame-bound syntax.
Examples
Uses streaming-play records for song 2, ordered users, and cumulative totals of 144, 350, and 654 seconds.
What you can do after
Apply window-frame syntax to calculate ordered cumulative totals in SQL.

Read how Just Use Postgres! explains window frame →

DuckDB in Action

A window frame is the set of rows positioned relative to the current row over which a window function is evaluated.

How it is used
Uses relative rows to compute moving aggregates and other per-row analyses over ordered partitions.
How deep it goes
Defines row and range boundaries and demonstrates a centered seven-day frame, stopping short of broader frame variations.
Examples
Demonstrates daily energy readings, system partitions, and a seven-day moving average using a range frame.
What you can do after
Apply it via SQL to calculate moving averages over row-based or range-based windows.

Read how DuckDB in Action explains window frame →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.