Search Postgresql Archives

Re: getting min/max of two values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux