Customers With the Most Orders
Medium
Ranking & Top-N
Return the customer_id of every customer who has the maximum number of orders (include ties). Order by customer_id.
Table schema
Orders(id INT PRIMARY KEY, customer_id INT)Sample data
id | customer_id
1 | 1
2 | 1
3 | 2
4 | 2
5 | 3
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.