🤔 문제 분석
1) Write an SQL query to find the for the customer who has placed the largest number of orders.
2) The test cases are generated so that exactly one customer will have placed more orders than any other customer.
💡 풀이
SELECT customer_number
FROM Orders
GROUP BY customer_number
ORDER BY COUNT(*) DESC
LIMIT 1
'코딩테스트 > 리트코드 SQL' 카테고리의 다른 글
[리트코드/SQL] 25. The Latest Login in 2020 (1890) (0) | 2022.12.18 |
---|---|
[리트코드/SQL] 24. Game Play Analysis I (511) (0) | 2022.12.18 |
[리트코드/SQL] 22. Find Followers Count (1729) (0) | 2022.12.18 |
[리트코드/SQL] 21. Daily Leads and Partners (1693) (0) | 2022.12.18 |
[리트코드/SQL] 20. User Activity for the Past 30 Days I (1141) (0) | 2022.12.18 |
댓글