18Compute a 7-day moving average and other rolling aggregates with SQL window frames.▼mediumMetaAmazonSnowflake2 replies○ sign inThe subtle part of rolling aggregates is the window frame clause, especially ROWS vs RANGE. The signal is the right frame for a moving window and the tied-rows gotcha that corrupts running totals.Open full answer →
46Explain the difference between RANGE and ROWS window frames, and when named windows help.▼hardSnowflakeDatabricksGoogle2 replies◆ premiumTwo queries that look identical apart from ROWS vs RANGE return different numbers, and most candidates cannot explain why. The signal is knowing RANGE groups by value (peers) while ROWS counts physical rows.Open full answer →