SQL - Advanced Window Functions
Given the table
Assume the data:
sales_data with columns id, sale_date, and amount, what is the output of this query?SELECT id, sale_date, amount, SUM(amount) OVER (ORDER BY sale_date) AS running_total FROM sales_data ORDER BY id;
Assume the data:
id | sale_date | amount
1 | 2024-01-01 | 100
2 | 2024-01-03 | 200
3 | 2024-01-02 | 150