Only JOIN and WITH (Common Table Expressions)
\n\nWITH min_year_table AS (\nSELECT product_id, min(year) min_year\nFROM sales\nGROUP BY product_id)\n\nSELECT s.product_id, s.year first_year, quantity, price
\n```\nWITH min_year_table AS (\nSELECT product_id, min(year) min_year\nFROM sales\nGROUP BY product_id)\n\nSELECT s.product_id, s.year first_year, quantity, price\nFROM sales s\nJOIN min_year_table m ON s.product_id = m.product_id and s.year = m.min_year\n```\n\n\n
['MySQL']