How can we inspect the subsequent order amount in the stream?
LEAD(column) retrieves the value from the subsequent row within the window.
Forward-looking session analysis, time until next transaction, funnel transition timing.
SELECT
order_date,
amount,
LEAD(amount) OVER (ORDER BY order_date) AS next_amount
FROM orders;Practice typing production-grade SQL code for LEAD.