Top Customer per Region
Medium
Inventory & E-commerce Cases
For each region return the customer with the highest total order amount (customer and total). Order by region.
Table schema
Orders(id INT PRIMARY KEY, customer VARCHAR(20), region VARCHAR(10), amount INT)Sample data
id | customer | region | amount
1 | A | East | 100
2 | B | East | 150
3 | C | West | 80
4 | A | East | 30
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.