
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
select cuisine_type, sum(price) total_pri,sum(price*discount_rate) discount_pri
from
(select f.cuisine_type, f.price, c.age, (c.age - 50) * 0.005 discount_rate
from food_orders f left join customers c on f.customer_id = c.customer_id
where c.age >= 50) a
group by 1
order by sum(price*discount_rate) desc

group by 1을 왜 하는지 모르겠어요.
범주화를 한다고 하시는데 왜 범주화하죠?
-----------------------------------------
select cuisine_type, sum(price) total_pri,sum(price*discount_rate) discount_pri
from
(select f.cuisine_type, f.price, c.age, (c.age - 50) * 0.005 discount_rate
from food_orders f left join customers c on f.customer_id = c.customer_id
where c.age >= 50) a
order by sum(price*discount_rate) desc

group by 가 없으면 왜 이렇게 되죠?
group by 1의 뜻은 같은 cuisine_type마다 묶으라는 거 맞나요?
이게 없으면 왜 결과가 1개만 나오는지 모르겠어요ㅠㅠ
