Preview the next value in sequence.
Section: LAG and LEAD basics
Next row with LEAD
sql
sql
SELECT day,
revenue,
LEAD(revenue) OVER (ORDER BY day) AS next_revenue
FROM daily_revenue;Explanation
Use `LEAD` for forward-looking comparisons or interval construction.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing LAG and LEAD basics