clause
PARTITION BY
Separates rows into independent window partitions. Example target: PostgreSQL 17 and SQLite (local fixture tested).
Formal Syntax & Structure
sql syntaxsql
OVER (PARTITION BY expression)Working Example
Example Snippetsql
SELECT id, COUNT(*) OVER (PARTITION BY customer_id) FROM orders ORDER BY id;