Simple solution using window function and rank
\nselect product_id,year as first_year,quantity,price\nfrom (\nselect product_id, year, quantity, price, rank() over (partition by product_id order by year asc)
```\nselect product_id,year as first_year,quantity,price\nfrom (\nselect product_id, year, quantity, price, rank() over (partition by product_id order by year asc) as rnk\nfrom Sales)a\nwhere a.rnk=1\n```
[]