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
'Issue Note' 카테고리의 다른 글
Difference between 'num for num in range' and 'for num in range' (Python) (0) | 2024.04.02 |
---|---|
Difference between list and [] (Python) (0) | 2024.04.02 |
DATE - [SQL} (0) | 2024.04.01 |
Exclusion of NULL values in b.customer_id column in SQL query [SQL] (0) | 2024.03.22 |
Table name from Subquery [SQL] (0) | 2024.03.21 |