Window functions compute across a set of table rows related to the current row without collapsing rows like `GROUP BY`.
sql
SELECT
account_id,
amount,
SUM(amount) OVER (PARTITION BY account_id ORDER BY created_at) AS running_balance,
RANK() OVER (ORDER BY amount DESC) as rank_pos
FROM transactions;