https://leetcode.com/problems/unique-orders-and-customers-per-month/
select date_format(order_date, '%Y-%m') as month, count(distinct order_id) as order_count, count(distinct customer_id) as customer_count
from Orders
where invoice > 20
group by month
728x90
반응형
'자료구조 알고리즘 > 코딩테스트' 카테고리의 다른 글
최댓값과 최솟값 (0) | 2022.09.16 |
---|---|
1251. Average Selling Price (0) | 2022.06.24 |
1421. NPV Queries (0) | 2022.06.24 |
740. Delete and Earn (0) | 2022.06.18 |
1777. Product's Price for Each Store (0) | 2022.06.18 |