MS SQL Solution, Beats 93.15%
Code\n\n/* Write your T-SQL query statement below */\nselect s1.product_id, s2.first_year, quantity, price \nfrom Sales s1 join (\n    select product_id, min(ye
# Code\n```\n/* Write your T-SQL query statement below */\nselect s1.product_id, s2.first_year, quantity, price \nfrom Sales s1 join (\n    select product_id, min(year) as first_year from Sales \n    group by product_id\n    ) s2\non s1.product_id = s2.product_id and s1.year = s2.first_year \n\n```\n\n![2024-07-23 17.32.47.jpg](https://assets.leetcode.com/users/images/e71a1d1e-2326-4754-8fb5-6be0e2e24cbe_1721820672.0873346.jpeg)\n
['MS SQL Server']