> -- Works as standard AVG. > create aggregate function custom_avg (i double precision) returns (o double > precision) as > declare count integer = 0; > declare accumulated double precision = 0; begin > while (not agg_finished) > do > begin > if (i is not null) then > begin > count = count + 1; > accumulated = accumulated + i; > o = accumulated / count; > end
How would this work within a GROUP BY context? I see how it works within a flat list, but when there are intermediate levels, I don't see this working. Sean Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel