PostgreSQL - Window Functions in PostgreSQL
Given the table
transactions(tx_date, value) ordered by tx_date, what does this query return?SELECT tx_date, value, AVG(value) OVER (ORDER BY tx_date RANGE BETWEEN INTERVAL '2 days' PRECEDING AND CURRENT ROW) AS avg_2days FROM transactions;
