所以我使用了一个等式,然后在最后修改代码的别名。我怎么才能绕过那个化名?我试着在整个方程上使用圆形函数,但没有结果,我得到了错误#1583。
下面是代码:
select product_name, list_price, discount_percent,
(.01 * discount_percent) * list_price as ROUND(discount_amount,2),
list_price - (.01 * discount_percent) * list_price as net_price
from products;我希望net_price和discount_amount值四舍五入。
发布于 2013-09-22 07:58:35
尝试:
select product_name, list_price, discount_percent,
ROUND( (.01 * discount_percent) * list_price, 2 ) as discount_amount,
ROUND( list_price - (.01 * discount_percent) * list_price, 2 ) as net_price
from products;https://stackoverflow.com/questions/18935515
复制相似问题