Indo Yoon
BlogTagsAbout
Published on
Thursday, June 9, 2022

Leetcode - 1158. Market Analysis I

Authors
  • avatar
    Name
    Indo Yoon
    Twitter
Table of Contents
  • 정답

문제

정답

SELECT user_id AS buyer_id, join_date, IFNULL(COUNT(order_date), 0) AS orders_in_2019
FROM Users
LEFT JOIN Orders ON user_id = buyer_id AND YEAR(order_date) = '2019'
GROUP BY user_id

Discuss on Twitter • View on GitHub

Tags

codingtest

Previous Article

Leetcode - 1667. Fix Names in a Table

Next Article

Leetcode - 1148. Article Views I
← Back to the blog
mailMailgithubGitHublinkedinLinkedin
Indo Yoon
•
© 2025
•
Indo Yoon
Tailwind Nextjs Theme