-
1158. Market Analysis I mysqlLeetCode_Study_Plan/SQL 2022. 10. 3. 19:12
https://leetcode.com/problems/market-analysis-i/
select u.user_id as buyer_id, u.join_date, IFNULL(tb.number, 0) as orders_in_2019 from (select buyer_id, count(order_id) as number from orders where order_date between "2019-01-01" and "2019-12-31" group by buyer_id) tb right join users u on tb.buyer_id = u.user_id;
'LeetCode_Study_Plan > SQL' 카테고리의 다른 글
1050. Actors and Directors Who Cooperated At Least Three Times mysql (0) 2022.10.04 182. Duplicate Emails mysql (0) 2022.10.04 1393. Capital Gain/Loss mysql (0) 2022.10.03 1407. Top Travellers mysql (0) 2022.10.03 1741. Find Total Time Spent by Each Employee mysql (0) 2022.10.02