
4주차 2번 강의보고, subquery 이용해서 음식타입별 평균금액에 따라 가중치(상중하)를 주는걸 해보고 있는데,
아래와 같이 subquery 쓰고, 각 cuisine_type 별로 상중하를 보려고 하니 저렇게 Korean 만 보여지네요 ㅠㅠ
group by cuisine_type했는데도 왜 안되는걸까요?
avg(price)를 지우니까, cuisine_type별로 다 보이긴하는데..

select case when food_type>18000 then '상'
when food_type between 15000 and 18000 then '중'
when food_type<15000 then '하'
end
food_type, cuisine_type, avg(price)
from
(
select price, cuisine_type , avg(price) food_type
from food_orders fo2
group by cuisine_type
) a
