-- 식품 분류별로 가격이 제일 비싼 식품(과자,국,김치,식용유만)
-- 식품의분류, 가격, 이름
-- 식품 가격 기준 내림차순 정렬
select category, price, productname
from foodproduct
where (category, price) in (select category, max(price) as maxprice
from foodproduct
where category in ('과자', '국', '김치', '식용유')
group by category)
order by price desc
풀이에 어려움을 겪고 있었는데 감사합니다