
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
제가 조회한 결과와 문제에서 예시로 조회한 사진 결과가 다른데 혹시 예시로 든 사진이 정확한 건지 질문드립니다.
보고 계신 화면 전체를 캡처해 주시면, 튜터님들이 빠르게

위에 사진은 제가 조회한 결과입니다.

위의 사진은 문제의 예시입니다.
작성한 코드 및 에러 메세지
SELECT cuisine_type,
max(if(age=10, cnt_order, 0)) "10대",
max(if(age=20, cnt_order, 0)) "20대",
max(if(age=30, cnt_order, 0)) "30대",
max(if(age=40, cnt_order, 0)) "40대",
max(if(age=50, cnt_order, 0)) "50대"
FROM
(
SELECT 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) cnt_order
FROM food_orders f
INNER JOIN customers s
ON f.customer_id = s.customer_id
WHERE s.age BETWEEN 10 AND 59
GROUP BY 1, 2
) a
GROUP BY 1
이렇게 쿼리를 작성했는데
예시와 저의 조회 결과가 달라서 질문드립니다.
