Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D - Mailing list pgsql-sql

From Craig Ringer
Subject Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D
Date
Msg-id 5056AC9E.4040909@ringerc.id.au
Whole thread Raw
In response to Re: ORDER BY COLUMN_A, (COLUMN_B or COLUMN_C), COLUMN_D  (Rodrigo Rosenfeld Rosas <rr.rosas@gmail.com>)
List pgsql-sql
On 09/13/2012 07:20 AM, Rodrigo Rosenfeld Rosas wrote:

> Thank you Gavin, I was looking for this LEAST function for a long time.
> I have tried MIN but it didn't work with strings.

In SQL, "MIN" is an aggregate function. It actually does work with 
strings, but only when used as an aggregate:

regress=# SELECT min(x.a) FROM ( VALUES ('blah'),('blah2'),('aaaa') ) x(a); min
------ aaaa
(1 row)

--
Craig Ringer



pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pg_restore problem
Next
From: Salomao Domingos
Date:
Subject: Disabling constraint check