18Compute a 7-day moving average and other rolling aggregates with SQL window frames.▼mediumMetaAmazonSnowflake2 replies○ sign inThe subtlety in rolling aggregates is the window frame clause, especially ROWS vs RANGE. The signal is the correct 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 except for ROWS vs RANGE return different numbers, and most candidates cannot say why. The signal is knowing RANGE groups by value (peers) while ROWS counts physical rows.Open full answer →