# Window Frame

The subset of rows around the current row used by a window function.

## What is **Window Frame** in a relational database?

**Window Frame** — The subset of rows around the current row used by a window function.

```sql
SELECT ordered_on,
       SUM(total_amount) OVER (
           ORDER BY ordered_on ROWS BETWEEN 2 PRECEDING AND CURRENT ROW
       ) AS running_total
FROM purchase_order;
```

Level: Journeyman · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/window-frame
