
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
실습을 강의에서는 subquery를 통해 계산했는데 subquery를 사용하지 않은 구문으로도 작업해 보고 싶어서 해봤는데
sum(f.price-((c.age-50)*0.005)) 'discounted'
구문에서 에러가 발생합니다. 어떻게 해결할 수 있을까요?
select f.cuisine_type,
sum(f.price),
sum((c.age-50)*0.005) 'discount'
sum(f.price-((c.age-50)*0.005)) 'discounted'
from food_orders f left join customers c on f.customer_id = c.customer_id
where c.age>=50
group by cuisine_type
SQL Error [1064] [42000]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sum(f.price-((c.age-50)*0.005)) 'discounted'
from food_orders f left join custo' at line 4
