Re: [SQL] How do I get min and max from an array of floating point values

2008-09-03 Thread Yura Gal
If you use intarray type it is convenient to call buil-in intarray functions for your purpose. http://www.postgresql.org/docs/8.3/static/intarray.html SELECT t.a[1] AS "min", t.a[array_upper(t.a, 1)] AS "max" FROM (SELECT sort(string_to_array('2,3,4,15,6,7',',')::int[]) AS a)t; -- Best regards,

Re: [SQL] How do I get min and max from an array of floating point values

2008-09-03 Thread Pavel Stehule
Hello 2008/9/2 pw <[EMAIL PROTECTED]>: > Hello, > > Is it possible to get the min and max from an array of > floating point values? > > The following doesn't return the min of the array values > it simply returns the complete array...(??) > > SELECT min(string_to_array('1,2,3,4,5,6,7',',')::float[