Re: [GENERAL] An aggregate function on ARRAY

2010-08-12 Thread Rafal Pietrak
On Wed, 2010-08-11 at 09:53 -0400, Merlin Moncure wrote: > On Wed, Aug 11, 2010 at 8:42 AM, Rafal Pietrak > wrote: [] > > > > SELECT min(A[1]) as a1, min(A[2]) as a2, ... > > > > This is because aggregate functions are not defined on ARRAY types. Or > > may be there is an easier and more read

Re: [GENERAL] An aggregate function on ARRAY

2010-08-11 Thread Merlin Moncure
On Wed, Aug 11, 2010 at 8:42 AM, Rafal Pietrak wrote: > Hi, > > I've started using ARRAY data type recently, and I fell into the > following problem: > > When I have a relatively large ARRAY (like [1:500]) takeing an aggregate > function on its elements is not so easy. One has to iterate all the >

[GENERAL] An aggregate function on ARRAY

2010-08-11 Thread Rafal Pietrak
Hi, I've started using ARRAY data type recently, and I fell into the following problem: When I have a relatively large ARRAY (like [1:500]) takeing an aggregate function on its elements is not so easy. One has to iterate all the elements, like this: SELECT min(A[1]) as a1, min(A[2]) as a2, ...