Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 493 Bytes

File metadata and controls

28 lines (20 loc) · 493 Bytes

中文文档

Description

None

Solutions

SQL

SELECT s.product_id,
         s.year AS first_year,
         s.quantity,
         s.price
FROM Sales s
WHERE (product_id, year) IN
    (SELECT product_id,
         min(year)
    FROM Sales
    GROUP BY  product_id)