PostgreSQL - Window Functions in PostgreSQL
You need to compute the running total of revenue per store ordered by transaction_time and reuse this window specification in multiple queries. Which approach is best?
WINDOW w AS (PARTITION BY store ORDER BY transaction_time) to specify the window once.SUM(revenue) OVER w to calculate running totals efficiently.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions