
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
sum(price*discount)로 정렬해주고 싶은데
결과가 price를 기준으로 정렬됩니다
order by 3 해도 똑같아요

select cuisine_type , sum(price) price, sum(price*discount) discount_price from( select fo.cuisine_type , fo.price, (c.age-50)*0.005 discount from customers c left join food_orders fo on c.customer_id =fo.customer_id where c.age>=50 )a group by 1 order by 3 desc
