From: Richard Broersma Jr <rabroersma@yahoo.com>
To: emilu@encs.concordia.ca, Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Get the max(value1, value2, value3) from a table
Date: Mon, 7 Jan 2008 14:27:40 -0800 (PST)
Message-ID: <239138.99803.qm@web31804.mail.mud.yahoo.com> (raw)
In-Reply-To: <dcc563d10801071416y4084231fie0261030ef4e071a@mail.gmail.com>
--- On Mon, 1/7/08, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> select max(col1) from table
> union all
> select max(col2) from table
> union all
> select max(col3) from table
Would the following work also?
SELECT MAX( GREATEST( col1, col2, col3 ) )
FROM TABLE;
Regards,
Richard Broersma Jr.
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rabroersma@yahoo.com, scott.marlowe@gmail.com
Subject: Re: Get the max(value1, value2, value3) from a table
In-Reply-To: <239138.99803.qm@web31804.mail.mud.yahoo.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