Обсуждение: "avg" function for arrays?

Поиск
Список
Период
Сортировка

"avg" function for arrays?

От
"G. Anthony Reina"
Дата:
I know that there's an "average" function (avg) for some datatypes.
Is there something comparable for float or int arrays?

e.g.
select avg(time_instants[1:5]) from ellipse_proc where rep = 1;            time_instants
-----------------------------------------{"148","167.8","187.6","207.4","227.2"}
(1 row)

select avg(time_instants[1:5]) from ellipse_proc where rep = 1;
ERROR:  Unable to select an aggregate function avg(_float4)

Thanks.
-Tony