pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bob Kruger <bkruger@mindspring.com>
To: pgsql-sql@postgresql.org
To: pgsql-general@postgresql.org
Subject: Select max field
Date: Wed, 10 Feb 1999 13:42:44 -0600
Message-ID: <3.0.5.32.19990210134244.007a8b10@mindspring.com> (raw)



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 




view thread (4+ messages)  latest in thread

Message-ID: <3.0.5.32.19990210134244.007a8b10@mindspring.com>
Permalink:  ../3.0.5.32.19990210134244.007a8b10@mindspring.com/
Also on:    postgresql.org/message-id/3.0.5.32.19990210134244.007a8b10@mindspring.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bkruger@mindspring.com, pgsql-general@postgresql.org
  Subject: Re: Select max field
  In-Reply-To: <3.0.5.32.19990210134244.007a8b10@mindspring.com>
  References: <3.0.5.32.19990210134244.007a8b10@mindspring.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox