Select max field - Mailing list pgsql-sql

From Bob Kruger
Subject Select max field
Date
Msg-id 3.0.5.32.19990210134244.007a8b10@mindspring.com
Whole thread Raw
Responses Re: [GENERAL] Select max field  (Bob Dusek <bobd@palaver.net>)
Re: [GENERAL] Select max field  (Bob Dusek <bobd@palaver.net>)
List pgsql-sql

I am looking for a way to determine the largest value of a number of fields
in a tuple.

Example:  In a table with the fields id_no, t1, t2 ,t3 ,t4 ,t5
          Select the id_no and the greatest value from fields t1, t2, t3,
t4, t5.

I have tried the following, but with no success:

select id_no, max(t1, t2, t3, t4, t5) from table_1 ;

Anyone have any suggestions?

Thanks in advance for any assistance.

Regards - Bob


pgsql-sql by date:

Previous
From: Fabrice Scemama
Date:
Subject: [Fwd: [SQL] Using Indexes with Pg]IamReal.
Next
From: pierre@desertmoon.com
Date:
Subject: Rule problem