Re: How do I get min and max from an array of floating point values - Mailing list pgsql-sql

From Yura Gal
Subject Re: How do I get min and max from an array of floating point values
Date
Msg-id 3b6c69d80809030542n5f17cd77x13f61dc09d914750@mail.gmail.com
Whole thread Raw
In response to Re: How do I get min and max from an array of floating point values  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-sql
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, Yuri.


pgsql-sql by date:

Previous
From: "Richard Broersma"
Date:
Subject: Re: order of rows in update
Next
From: "Christopher Maier"
Date:
Subject: Case-insensitive string prefix matching with parameterized query