Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Adding the pennies correctly
It is possible that this is the result of rounding errors between internal and decimal representation which happens to cancel out over the full data set, but doesn't over the grouped set.
It would be interesting to try:
sum(trunc(100 * amount))/100
group by district and see what happens.
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Ian Brown wrote in message <01bec0c9$fa045520$159793c3_at_default>...
>I have run two queries on a 5.8m record table. One verifies that the sum of
>the amount field [NUMERIC (14,2)] is £0.00. When I add a "District" field
>to the output and add GROUP BY the sum of the individual District totals is
>£0.03
>
>Can anyone tell me what is going on and, more importantly, how to properly
>report the District totals for a table that is in balance?
>
>Thanks in advance.
>
>Ian Brown
Received on Sun Jun 27 1999 - 15:13:35 CDT