SQL - Advanced Window Functions
Given the table
Assuming data:
day: 1, 2, 3
temp: 10, 20, 30
temps with columns day and temp, what will be the output of this query?SELECT day, temp, AVG(temp) OVER (ORDER BY day ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS moving_avg FROM temps ORDER BY day;
Assuming data:
day: 1, 2, 3
temp: 10, 20, 30
