SELECT user_id, SUM(amount) AS total_spend
FROM orders
WHERE created_at >= '2026-01-01' AND created_at < '2027-01-01'
GROUP BY user_id
ORDER BY total_spend DESC
LIMIT 5;
This query filters orders for the year 2026, aggregates the total spend per user, and returns the top 5 highest-spending users in descending order.