getting min/max of two values
Started by rihadover 18 years ago3 messagesgeneral
How can I efficiently return the minimum/maximum of two given
expressions? Like SELECT MYMIN(a+b-c,d+e*f).
Thanks.
Re: getting min/max of two values
2007/9/15, rihad <rihad@mail.ru>:
How can I efficiently return the minimum/maximum of two given
expressions? Like SELECT MYMIN(a+b-c,d+e*f).Thanks.
Hello
use function GREATEST (maximim) or LEAST (minimum)
http://www.postgresql.org/docs/8.2/interactive/functions-conditional.html#AEN13148
Regards
Pavel Stehule