SQL - Advanced Query Patterns
Given the table
What is the output of this query?
sales with rows:id | amount
1 | 10
2 | 20
3 | 15What is the output of this query?
SELECT id, amount, (SELECT SUM(amount) FROM sales WHERE id <= s.id) AS running_total FROM sales s ORDER BY id;
