Re: Get the max(value1, value2, value3) from a table

Поиск
Список
Период
Сортировка
Искать
От
Josh Williams
Тема
Re: Get the max(value1, value2, value3) from a table
Дата
Msg-id
1199745537.5877.9.camel@godzilla.local.scalefeather.com
Ответ на
Список
Дерево обсуждения
Get the max(value1, value2, value3) from a table Emi Lu <emilu@encs.concordia.ca>
Re: Get the max(value1, value2, value3) from a table Josh Williams <joshwilliams@ij.net>
Re: Get the max(value1, value2, value3) from a table "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Get the max(value1, value2, value3) from a table Emi Lu <emilu@encs.concordia.ca>
Re: Get the max(value1, value2, value3) from a table "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Get the max(value1, value2, value3) from a table Erik Jones <erik@myemma.com>
Re: Get the max(value1, value2, value3) from a table "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Get the max(value1, value2, value3) from a table Richard Broersma Jr <rabroersma@yahoo.com>
Re: Get the max(value1, value2, value3) from a table Emi Lu <emilu@encs.concordia.ca>
Re: Get the max(value1, value2, value3) from a table "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Get the max(value1, value2, value3) from a table "Scott Marlowe" <scott.marlowe@gmail.com>
On Mon, 2008-01-07 at 17:03 -0500, Emi Lu wrote:
> select ?max?(col1, col2, col3) as result;
> will return
> 
> result
> -------
> 5
> 8
> 12
> 
> (3 rows)

8.1 (I believe?) introduced GREATEST(), which does precisely what you're
looking for.

But if 8.0 is a must, you'll probably have to create your own function
to do that.  Which should be fairly easy to do if you're working with a
static number of columns/data types/etc...
- Josh



В списке pgsql-sql по дате отправления
От: Emi Lu
Дата:
От: Scott Marlowe
Дата:
FAQ