Subject | Re: [firebird-support] Re: Aggregate UDF? |
---|---|
Author | Milan Babuskov |
Post date | 2010-06-25T13:17:04Z |
PenWin wrote:
STDDEV(x) = AVG( x^2 - (AVG(x))^2 )
?
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================
> Dne 25.6.2010 14:29, Michael Ludwig napsal(a):Isn't it rather:
>> Svein Erling schrieb am 25.06.2010 um 11:16 (-0000):
>>
>>> [...] isn't it an aggregate function that requires 'going through'
>>> records twice (first finding the average and then how much each value
>>> deviates from this value)?
>> Yes, exactly. Conceptually, it cannot be done in one pass.
>
> Actually, it can.
>
> STDDEV(x) = AVG(x^2) - (AVG(x))^2
>
> AVG can be calculated in one pass.
STDDEV(x) = AVG( x^2 - (AVG(x))^2 )
?
--
Milan Babuskov
==================================
The easiest way to import XML, CSV
and textual files into Firebird:
http://www.guacosoft.com/xmlwizard
==================================