For each month with orders, return month, revenue and prev_revenue (the previous month that had orders), in month order.
12 rows with columns month, revenue, prev_revenue — first 3 shown:
| # | |||
|---|---|---|---|
| 1 | 2024-01-01 00:00:00 | 9941 | NULL |
| 2 | 2024-02-01 00:00:00 | 7392 | 9941 |
| 3 | 2024-03-01 00:00:00 | 11689 | 7392 |
Run your code to see the output here.