A finance report compares each month's revenue with the month before. The first month has no previous value, so it shows NULL.
Write a query returning month, revenue and the previous month's revenue as prev_revenue, using LAG(), with the rows ordered by month.
month, revenue, prev_revenueprev_revenue is NULLmonth ascendingLAG(column) OVER (ORDER BY ...) reads the value from the previous row.
Add a normal ORDER BY month at the end to order the output.
No results yet
Run your code to check it against the examples, or submit to run every test.