Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- 당신의 인생이 왜 힘들지 않아야 한다고 생각하십니까
- TensorFlowGPU
- 프로그래머스
- Labor Management System
- ABC Analysis
- 파이썬
- Product Demand
- 코딩테스트
- pandas profiling
- 데이터분석
- SQL
- HackerRank
- 신경쓰기의 기술
- MS SQL Server
- leetcode
- tensorflow
- forecast
- oracle
- ProfileReport
- 딥러닝
- 피그마인디언
- MySQL
- 웨어하우스 보관 최적화
- 코딩테스트연습
- eda
- kaggle
- SKU Consolidation
- ModelCheckPoint
- Gaimification
- Inventory Optimization
Archives
- Today
- Total
오늘도 배운다
1070. Product Sales Analysis III / LeetCode, SQL, MySQL 본문
코딩테스트연습(SQL)
1070. Product Sales Analysis III / LeetCode, SQL, MySQL
LearnerToRunner 2023. 4. 10. 22:48문제
source: LeetCode
Write an SQL query that selects the product id, year, quantity, and price for the first year of every product sold.
Return the resulting table in any order.
제출답안(MySQL)
SELECT
product_id, year AS first_year, quantity, price
FROM
sales
WHERE
(product_id, year) IN (SELECT product_id, MIN(year) as first_year
FROM sales
GROUP BY product_id)
문제 바로가기(MySQL)
728x90
'코딩테스트연습(SQL)' 카테고리의 다른 글
1174. Immediate Food Delivery II / LeetCode, SQL, MySQL (0) | 2023.04.11 |
---|---|
1193. Monthly Transactions I / LeetCode, SQL, MS SQL Server (0) | 2023.04.10 |
585. Investments in 2016 / LeetCode, SQL, MySQL (0) | 2023.04.10 |
570. Managers with at Least 5 Direct Reports / LeetCode, SQL, MS SQL Server (0) | 2023.04.04 |
대여 횟수가 많은 자동차들의 월별 대여 횟수 구하기 / 프로그래머스, SQL, MySQL (0) | 2023.04.02 |
Comments