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

Поиск
Список
Период
Сортировка
От Emi Lu
Тема Re: Get the max(value1, value2, value3) from a table
Дата
Msg-id 4782A9C4.1030104@encs.concordia.ca
обсуждение исходный текст
Ответ на 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  ("Scott Marlowe" <scott.marlowe@gmail.com>)
Список pgsql-sql
> 
>> select max(col1) from table
>> union all
>> select max(col2) from table
>> union all
>> select max(col3) from table
No, this is not what I prefer; it makes complicate query.


> 
> Would the following work also?
> 
> SELECT MAX( GREATEST( col1, col2, col3 ) )
>   FROM TABLE;

I would prefer this func. Unfortunately, the current version I have 
8.02(http://www.postgresql.org/docs/8.0/static/functions-conditional.html) 
does not support this func I am afraid :(

Thanks !
Ly.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Get the max(value1, value2, value3) from a table
Следующее
От: Josh Williams
Дата:
Сообщение: Re: Get the max(value1, value2, value3) from a table