Subject AW: [firebird-support] Geometric average
Author Steffen Heil
Hi

> 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;
...

Regards,
Steffen