
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
안녕하세요. 과제하면서 질문이 있어서 올립니다.
select f.cuisine_type,
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 age,
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, 2
와
select f.cuisine_type,
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 age,
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
에서 마지막 group by 1,2 했을 때와 group by 1 했을 때 결과가 다르게 나오는데
두 개의 차이점이 어떻게 다른지 설명하지 못하겠습니다. 설명 부탁드립니다. 감사합니다!
group by 1,2 일 때의 결과

group by 1 일 때의 결과

