leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

1158.sql (241B)


0 SELECT U.user_id AS buyer_id,
1 U.join_date,
2 COUNT(O.buyer_id) AS orders_in_2019
3 FROM Users U
4 LEFT JOIN (
5 SELECT buyer_id
6 FROM Orders
7 WHERE YEAR(order_date) = 2019
8 ) AS O
9 ON U.user_id = O.buyer_id
10 GROUP BY U.user_id