Moving Averages and Rolling Sums in SQL (and the Missing-Day Trap)
How to calculate moving averages and rolling sums in SQL Server, MySQL and PostgreSQL with window frames, hide incomplete windows, and get the right answer when some dates are missing.









