Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
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
31
Tags
more
Archives
Today
Total
관리 메뉴

dearbeany

[프로그래머스] 식품분류별 가장 비싼 식품의 정보 조회하기 본문

Oracle

[프로그래머스] 식품분류별 가장 비싼 식품의 정보 조회하기

dearbeany 2023. 11. 25. 02:29
select a.category, b.max_price, a.product_name
from FOOD_PRODUCT a, (
    select category, max(price) as max_price
    from food_product
    where category in ('과자', '국', '김치', '식용유')
    group by category) b
where a.category = b.category
and a.price = b.max_price
order by 2 desc;