Received: from camel8.mindspring.com (camel8.mindspring.com [207.69.200.58]) by hub.org (8.9.2/8.9.1) with ESMTP id OAA85044; Wed, 10 Feb 1999 14:43:13 -0500 (EST) (envelope-from bkruger@mindspring.com) Received: from bkruger (user-38s00b5.dialup.mindspring.com [209.192.1.101]) by camel8.mindspring.com (8.8.5/8.8.5) with SMTP id OAA22056; Wed, 10 Feb 1999 14:43:11 -0500 (EST) Message-Id: <3.0.5.32.19990210134244.007a8b10@mindspring.com> X-Sender: bkruger@mindspring.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Wed, 10 Feb 1999 13:42:44 -0600 To: pgsql-sql@postgresql.org, pgsql-general@postgresql.org From: Bob Kruger Subject: Select max field Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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