728x90
https://leetcode.com/problems/customer-placing-the-largest-number-of-orders/
[problem]
order_number가 가장 많은 customer 출력
[anlysis]
1. order no 가장많은 = select top 1이용
2. count(*)
select 변수 order by count(*)를 통해 행의 개수를 출력할 수 있다
[solution]
728x90
'MS SQL > MS SQL : Leetcode' 카테고리의 다른 글
SQL - 627. Swap Salary (update, case when) (0) | 2022.04.27 |
---|---|
SQL - 511. Game Play Analysis I (min, group by) (0) | 2022.04.26 |
SQL - 183. Customers Who Never Order (left join, where) (0) | 2022.04.26 |
SQL - Leetcode 620. Not Boring Movies (where, order by) (0) | 2022.04.25 |
SQL - Leetcode 175. Combine Two Tables (left join) (0) | 2022.04.25 |