Reputation: 55
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(partition by ID)))/5),0) avg_qty
Thanks in advance.
Upvotes: 4
Views: 37121
Reputation: 8386
If you always want to "round" down, the function is trunc
. This should work for you:
select trunc(3.99999, 1) from dual;
Result
3.9
Upvotes: 12