🏠 Startseite
Vergleiche
📊 Alle Benchmarks 🦖 Dinosaurier v1 🦖 Dinosaurier v2 ✅ To-Do-Listen-Apps 🎨 Kreative freie Seiten 🎯 FSACB - Ultimatives Showcase 🌍 Übersetzungs-Benchmark
Modelle
🏆 Top 10 Modelle 🆓 Kostenlose Modelle 📋 Alle Modelle ⚙️ Kilo Code
Ressourcen
💬 Prompt-Bibliothek 📖 KI-Glossar 🔗 Nützliche Links
Hard

Advanced SQL Window Functions

#sql #database #data-analysis

Construct a complex query using window functions to analyze time-series data.

Write a PostgreSQL query that calculates the 3-day moving average of sales for each product, alongside the difference from the previous day's sales, partitioned by store location. Handle NULL values by carrying forward the last known value using the IGNORE NULLS option within the window frame.