문제
정답
SELECT Sales.product_id, first_year, quantity, price
FROM Sales
JOIN (
SELECT product_id, MIN(year) as first_year
FROM Sales
GROUP BY product_id
) as Temp ON Sales.year = Temp.first_year AND Sales.product_id = Temp.product_id
SELECT Sales.product_id, first_year, quantity, price
FROM Sales
JOIN (
SELECT product_id, MIN(year) as first_year
FROM Sales
GROUP BY product_id
) as Temp ON Sales.year = Temp.first_year AND Sales.product_id = Temp.product_id