
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
5주차 숙제 중 어느 부분이 오류인지 모르겠어서 문의드립니다ㅜ

작성한 코드 및 에러 메세지
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 between 10 and 19 then 10,
when age between 20 and 29 then 20,
when age BETWEEN 30 and 39 then 30,
when age BETWEEN 40 and 49 then 40,
when age BETWEEN 50 and 59 then 50 end age,
COUNT(1) order_count
FROM food_orders f inner join customers c on f.customer_id=c.customer_id
where age BETWEEN 10 and 59
group by 1,2
) a
group by 1
에러메세지
SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',
when age between 20 and 29 then 20,
when age BETWEEN' at line 10
Error position: line: 9
