clause

WINDOW

Names a reusable window definition within a SELECT. Example target: PostgreSQL 17 and SQLite (local fixture tested).

Formal Syntax & Structure

sql syntaxsql
WINDOW name AS (window_definition)

Working Example

Example Snippetsql
SELECT id, COUNT(*) OVER w FROM orders WINDOW w AS (PARTITION BY customer_id) ORDER BY id;
SQL Reference