Month-over-Month and Year-over-Year Comparisons in SQL (With LAG)
How to compare this month with last month and with the same month last year in SQL: LAG for month-over-month, a safe date join for year-over-year, year-to-date totals, and the missing-month trap.









