Re: getting min/max of two values - Mailing list pgsql-general

From Jeff Davis
Subject Re: getting min/max of two values
Date
Msg-id 1189877563.5924.115.camel@jdavis
Whole thread Raw
In response to getting min/max of two values  (rihad <rihad@mail.ru>)
List pgsql-general
On Sat, 2007-09-15 at 12:40 +0500, rihad wrote:
> How can I efficiently return the minimum/maximum of two given
> expressions? Like SELECT MYMIN(a+b-c,d+e*f).
>

SELECT LEAST(a+b-c,d+e*f);
SELECT GREATEST(a+b-c,d+e*f);

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: text_pattern_ops index *not* used in field = value condition?
Next
From: Marinos Yannikos
Date:
Subject: read-only queries on PITRslaves, any progress?