본문 바로가기
Issue Note

Red highlighted error [SQL]

by jhleeatl 2024. 3. 21.

 

I received an error message, but the result is fine. I can't find any issues, but the SQL system highlighted the word.

 

SELECT a.cuisine_type,
	   a.price,
	   discount,
	   age, 
	 a.price-(price*discount) 'after_discount'
FROM 
(
SELECT a.cuisine_type,
	   a.price,
	   b.age,
	   if(b.age>50,(b.age-50)*0.005,0) 'discount'
from food_orders a left join customers b on a.customer_id=b.customer_id
) a
order by discount desc