
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
안녕하세요. 5주차 숙제 풀이를 하였습니다. SQL문은 잘 작성한 것 같은데, 어떤 부분에서 실수를 한 것인지 숙제 문제에서 보이는 Pivot view와 제 SQL문의 결과에 의한 Pivot view의 값이 약간씩 차이가 있습니다.
제가 작성한 SQL문에서 어떤 문제가 있는 것인지, 원인이 무엇인지 알려주세요.
보고 계신 화면 전체를 캡처해 주시면, 튜

터님들이 빠르게 상황을 이해할 수 있어요.
select cuisine_type, max(if(generation=10, cnt_order, 0)) '10대', max(if(generation=20, cnt_order, 0)) '20대', max(if(generation=30, cnt_order, 0)) '30대', max(if(generation=40, cnt_order, 0)) '40대', max(if(generation=50, cnt_order, 0)) '50대' from (select f.cuisine_type, c.age, case when c.age between 10 and 19 then 10 when c.age between 20 and 29 then 20 when c.age between 30 and 39 then 30 when c.age between 40 and 49 then 40 when c.age between 50 and 59 then 50 end generation, count(1) cnt_order from food_orders f inner join customers c on f.customer_id=c.customer_id where c.age between 10 and 59 group by 1,3 ) a group by 1
