
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
질문해결 버튼 눌러서 다시 확인 부탁드립니다.

작성한 코드 및 에러 메세지
SELECT cuisine_type,
max(if(age=10, order_count, 0) "10대",
max(if(age=20, order_count, 0) "20대",
max(if(age=30, order_count, 0) "30대",
max(if(age=40, order_count, 0) "40대",
max(if(age=50, order_count, 0) "50대"
from
(
SELECT f.cuisine_type,
case when age < 20 and age > 10 then 10
when age >= 20 and age < 30 then 20
when age >= 30 and age < 40 then 30
when age >= 40 and age < 50 then 40
when age >= 50 and age < 60 then 50
end age
count(1) order_count
where age BETWEEN 10 and 59
from food_orders f inner join customers c on f.customer_id=c.customer_id
group by 1,2
) t
group by 1
