Subject | Re: AW: [firebird-support] Geometric average |
---|---|
Author | Miroslav Penchev |
Post date | 2004-09-06T11:57:24Z |
On Mon, 6 Sep 2004 13:51:57 +0200, Steffen Heil <lists@...>
wrote:
--
Miroslav Penchev
wrote:
> HiIt needs function like 'Power' to calculate (...)^1/n;
>
>> Is there any way to calcule a geometric average of a column using FB?
>> I mean (v0*v1*v2...vn)^1/n
>> Also, the total product of v0*v1*v2...vn is valid for me.
>
> Yes. Write a stored procedure.
>
> ...
> for select v from talbe into :v do begin
> v_total := :v_total * :v;
> v_count := :v_count + 1;
> end;
> v_result := :v_total / :v_count;
> ...
--
Miroslav Penchev