Always use
LAG
instead of trying to join tables back to themselves like a
clown amateur. It's way cleaner for calculating day-over-day growth in your dashboarding layer.
SELECTdate,revenue,LAG(revenue) OVER (ORDER BY date) as prev_day_revFROM daily_sales