Total Spend per Customer
For each customer return the total amount they have spent, ordered by total spend descending.
Table schema
Orders(id INT PRIMARY KEY, customer_id INT, amount INT)Sample data
id | customer_id | amount
1 | 1 | 100
2 | 2 | 200
3 | 1 | 150
4 | 3 | 50
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.