Write a query to identify top-performing products based on specific time-window criteria at Wayfair.
Use completed orders from the current 30-day window, 2025-01-01 through 2025-01-30, and compare them with the preceding 30-day window, 2024-12-02 through 2024-12-31. Return the three products with the highest current-window revenue.
Output
- One row per qualifying product with
product_id, product_name, current_revenue, previous_revenue, and revenue_change_percent
- Include products with no previous-window revenue, representing the percentage as NULL
- Sort by
current_revenue descending, then product_id ascending