Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: result precision and scale of the arithmentic expressions and aggregate functions
On 27 Jun 2003 10:18:46 -0700, lanegroups_at_go.com (Lan Huang) wrote:
>I'd like to know what's the result precision and scale of the decimal
>arithmentic expression and aggregate function.
>
>For example, what's the result type of
>decimal(p1, s1)+decimal(p2, s2)
>decimal(p1, s1)-decimal(p2, s2)
>decimal(p1, s1)*decimal(p2, s2)
>decimal(p1, s1)/decimal(p2, s2)
>AVG(decimal(p1, s1))
>etc
the result type of a number function is simply number, which means number(38)
>
>I tested several cases in Oracle, the scales of the results are 9 in
>all the cases I tried. For example, 1/3 returns .999999999 from
>Oracle. Is 9 always the maximal scale Oracle returns?
definitely not. What you see is always subject to format masks.
>
>It will also be nice if someone tell me which documentation describes
>the result types of the expressions and functions.
That is most likely described in the sql reference manual.
>
>Thanks,
>Lan
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Fri Jun 27 2003 - 15:18:54 CDT