#99. [LeetCode / MySQL] 1070. Product Sales Analysis III

문제

 

입력 코드

SELECT product_id, year AS first_year, quantity, price 
FROM Sales
WHERE (product_id, year) in (
  SELECT product_id, MIN(year)
  FROM Sales
  GROUP BY product_id
)

 

코드 설명

#SELECT #MIN #GROUP BY #SUBQUERY

 

 

문제 출처

 

LeetCode - The World's Leading Online Programming Learning Platform

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com