/*
with cte as
(
select product_id, year as first_year, quantity, price,
dense_rank() over(partition by product_id order by year) as denserank
from Sales
)
select product_id, first_year, quantity, price
from cte
where denserank=1
*/
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)
The first solution can change the number of the year, the second solution is easier.
1070. Product Sales Analysis III
The first solution can change the number of the year, the second solution is easier.