Subject | AW: [firebird-support] Geometric average |
---|---|
Author | Steffen Heil |
Post date | 2004-09-06T11:51:57Z |
Hi
...
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;
...
Regards,
Steffen
> Is there any way to calcule a geometric average of a column using FB?Yes. Write a stored procedure.
> I mean (v0*v1*v2...vn)^1/n
> Also, the total product of v0*v1*v2...vn is valid for me.
...
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;
...
Regards,
Steffen