Home / Guides / Self-Hosting & Infra
SQL Window Functions Cookbook: Running Totals, Top-N per Group, LAG and Moving Averages
A cookbook for SQL window functions with outputs from SQLite 3.37: OVER, PARTITION BY, ORDER BY, running sums, ROW_NUMBER versus RANK versus DENSE_RANK, LAG, frames, percent of total, and the LAST_VALUE trap.
Read the full guide
The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.
Open in the Knowledge Base Agent API →