问题描述
这是我的部分陈述.该语句有效,并接收值4,但在某些情况下,我更喜欢3.9,该数字可能不是整数,而是.4,.2,.1等.这些数字当前显示为"0",因为Oracle四舍五入.如果删除回合",则会收到3.9123458543845474586.有没有办法只显示3.9和.4,.2等而不四舍五入?我知道它一定是语法问题.当我移除回合时,我会收到错误消息.
Here my partial statement. The statement works and receive the value of 4 but instead I would prefer 3.9 in some cases the number may not be a whole number but .4,.2,.1 etc. Those numbers currently show up as "0" because Oracle rounds up. If I remove "round" I receive 3.9123458543845474586. Is there a way to display 3.9 only and .4,.2 etc. without the rounding? I know its got to be a syntax issue. When I remove round I receive an error.
round((total_qty)*((avg_qty/(sum(avg_qty)over(按ID划分)))/5),0)avg_qty
round((total_qty)*((avg_qty/(sum(avg_qty)over(partition by ID)))/5),0) avg_qty
谢谢.
推荐答案
尝试这样,
SELECT ROUND(3.9123458543845474586, 1) Round FROM DUAL;
Round
----------
3.9
为更好地理解,请参考此链接.
For better understanding please refer this link.
这篇关于Oracle四舍五入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!