Re: What can I use as a [non-aggregate] minimum function

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Chris Albertson <chrisalbertson90278(at)yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Paul Wehr <postgresql(at)industrialsoftworks(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: What can I use as a [non-aggregate] minimum function
Date: 2001-12-11 04:22:51
Message-ID: 20011211152251.A771@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 10, 2001 at 09:07:28PM -0800, Chris Albertson wrote:
>
> All you need is a "max" function with two arguments. To find the
> max of four numbers you can do this
>
> max(max(max(a,b),c),d)
>
> It is not even all that ugly.

This function even exists, though it's called int4larger. I know the
function exists but I can never remember the name and have to scan through
the function list each time to find it.

There's also cashlarger, date_larger, float4larger, float8larger,
int2larger, int8larger, interval_larger, numeric_larger, text_larger,
time_larger, timestamp_larger and timetz_larger. (Consistant naming huh?).
The opposites are *smaller.

HTH,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org>
http://svana.org/kleptog/
> Terrorists can only take my life. Only my government can take my freedom.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Albertson 2001-12-11 05:07:28 Re: What can I use as a [non-aggregate] minimum function
Previous Message Justin Clift 2001-12-11 03:02:47 Re: Analyzer for postgresql.log