Skip to content

Commit 372e45c

Browse files
committed
[level 4] Title: 식품분류별 가장 비싼 식품의 정보 조회하기, Time: 0.00 ms, Memory: 0.0 MB -BaekjoonHub
1 parent e0d2903 commit 372e45c

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

프로그래머스/4/131116. 식품분류별 가장 비싼 식품의 정보 조회하기/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Empty
1616

1717
### 제출 일자
1818

19-
2025년 11월 10일 11:02:22
19+
2025년 11월 10일 11:11:19
2020

2121
### 문제 설명
2222

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
-- 코드를 입력하세요
12
SELECT
2-
category,
3-
price AS max_price,
4-
product_name
5-
FROM food_product
6-
WHERE category IN ('식용유', '과자', '', '김치')
7-
AND (category, price) IN (
8-
SELECT category, MAX(price)
9-
FROM food_product
10-
WHERE category IN ('식용유', '과자', '', '김치')
11-
GROUP BY category
12-
)
13-
ORDER BY max_price DESC;
3+
category,
4+
price as max_price,
5+
product_name
6+
from food_product
7+
where category in ('식용유', '김치', '', '과자')
8+
and (category, price) in (
9+
select category, max(price)
10+
from food_product
11+
where category in ('식용유', '김치', '', '과자')
12+
group by category
13+
)
14+
group by category, product_name
15+
order by max_price desc;

0 commit comments

Comments
 (0)