"George Pavlov" <gpavlov@mynewplace.com> writes:
> The datatype of both city.latitude and postal_code.latitude is
> number(16,12).
> This works, but I would like to understand why there is sometimes a
> discrepancy between avg(pc.latitude) and what actually gets inserted
> into the city table -- is it the usual floating-point discrepancy or is
> there something I can do about it? E.g. after the above update:
You're forcing the result of the avg() calculation to be rounded to 12
digits when you store it into city.latitude. Your example simply shows
that the avg() calculation is being done to more precision than that.
regards, tom lane