Re: Get the max(value1, value2, value3) from a table - Mailing list pgsql-sql

From Emi Lu
Subject Re: Get the max(value1, value2, value3) from a table
Date
Msg-id 4782A9C4.1030104@encs.concordia.ca
Whole thread Raw
In response to Re: Get the max(value1, value2, value3) from a table  (Richard Broersma Jr <rabroersma@yahoo.com>)
Responses Re: Get the max(value1, value2, value3) from a table  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List 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 by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Get the max(value1, value2, value3) from a table
Next
From: Josh Williams
Date:
Subject: Re: Get the max(value1, value2, value3) from a table