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

조민수·2024년 6월 6일
0

LeetCode

목록 보기
20/75

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
멈춤에 두려움을 느끼는 것

0개의 댓글

관련 채용 정보