Skip site navigation (1) Skip section navigation (2)

Greatest/Least functions?

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: pgsql-general(at)postgresql(dot)org (pgsql general list)
Subject: Greatest/Least functions?
Date: 2004-08-22 16:42:58
Message-ID: 200408221642.i7MGgwHR008997@gw.tssi.com (view raw or flat)
Thread:
Lists: pgsql-general
As far as I can tell, Postgres has no equivalent to greatest and least
functions in Oracle.  Yes, you can do the same thing with a case statement,
but at the expense of writing MUCH longer SQL statements.

Is this something that is on or can be added to the 'to do' list?

I could write a series of user-defined functions to do specific 
comparisons (such as comparing several dates and returning the greatest 
one) but there doesn't appear to be a way to write a user function with a 
variable number of parameters, either, so I guess I'd have to define a
series of them with 2,3,4,... parameters.
--
Mike Nolan

Responses

pgsql-general by date

Next:From: Marc G. FournierDate: 2004-08-22 16:48:32
Subject: Re: Unsupported 3rd-party solutions (Was: Few questions
Previous:From: Mike NolanDate: 2004-08-22 16:25:55
Subject: Re: Unsupported 3rd-party solutions (Was: Few questions on postgresql (dblink, 2pc, clustering)) (fwd)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group