PostgreSQL - Window Functions in PostgreSQL
Given the table
orders with columns order_id and amount, what will this query return?SELECT order_id, amount, LAG(amount) OVER (ORDER BY order_id) AS prev_amount FROM orders;
