Min and max element of an array column

From: Gianvito Pio <pio(dot)gianvito(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Min and max element of an array column
Date: 2009-09-02 10:58:08
Message-ID: 4A9E4FC0.1010908@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,
is it possible to obtain the minimum and the maximum single element of
an array column?

Example:
[1, 2 ,5]
[3, -1, 6]
[9, 18,-4 ]

I'd just like to make a query that gives me the min (-4) and the max(18)
of the column. Is that possible without a function? Thanks

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message A. Kretschmer 2009-09-02 11:26:10 Re: Min and max element of an array column
Previous Message A. Kretschmer 2009-09-02 08:33:39 Re: How to create Function which retruns username and password