Skip to content

Commit 6de624b

Browse files
authored
[PGS] 131116 식품분류별 가장 비싼 식품의 정보 조회하기 (Lv.4)
1 parent a318a64 commit 6de624b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

박예진/8주차/260217.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
select
2+
f1.category,
3+
f1.price as max_price,
4+
f1.product_name
5+
from food_product f1
6+
join (
7+
select
8+
category,
9+
max(price) as max_price
10+
from food_product
11+
where category in ('과자', '', '김치', '식용유')
12+
group by category
13+
) f2
14+
on f1.category = f2.category and f1.price = f2.max_price
15+
order by max_price desc;

0 commit comments

Comments
 (0)