문제
입력 코드
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
)
코드 설명
#SELECT #MIN #GROUP BY #SUBQUERY
문제 출처
'SQL' 카테고리의 다른 글
#101. [LeetCode / MySQL] 1729. Find Followers Count (0) | 2023.09.27 |
---|---|
#100. [LeetCode / MySQL] 596. Classes More Than 5 Students (0) | 2023.09.26 |
#98. [LeetCode / MySQL] 1141. User Activity for the Past 30 Days I (0) | 2023.09.24 |
#97. [LeetCode / MySQL] 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.09.23 |
#96. [LeetCode / MySQL] 550. Game Play Analysis IV (0) | 2023.09.22 |