LeetCode - 586. Customer Placing the Largest Number of Orders (MySQL)

조민수·2024년 6월 6일
0

LeetCode

목록 보기
20/64
post-custom-banner

Easy, SQL - GROUP BY

RunTime : 501 ms


문제

Write a solution to find the customer_number for the customer who has placed the largest number of orders.

The test cases are generated so that exactly one customer will have placed more orders than any other customer.

The result format is in the following example.


풀이

  • 단순하게 가장 많이 나온 걸 찾는 문제
SELECT customer_number FROM Orders
GROUP BY customer_number
ORDER BY COUNT(customer_number) DESC
LIMIT 1
profile
사람을 좋아하는 Front-End 개발자
post-custom-banner

0개의 댓글