pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: emilu@encs.concordia.ca
Cc: Richard Broersma Jr <rabroersma@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Get the max(value1, value2, value3) from a table
Date: Mon, 7 Jan 2008 16:40:04 -0600
Message-ID: <dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.com> (raw)
In-Reply-To: <4782A9C4.1030104@encs.concordia.ca>
References: <239138.99803.qm@web31804.mail.mud.yahoo.com>
	<4782A9C4.1030104@encs.concordia.ca>

On Jan 7, 2008 4:37 PM, Emi Lu <emilu@encs.concordia.ca> wrote:
>
> >
> >> 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.

Generally speaking when you have to make complicated queries to get
simple answers, then it's likely you have a normalization issue.  IF
col1, col2, col3 were all a single column in an external table the
answer would likely fall out a little simpler.

But honestly, that's not a real complex query.  PostgreSQL handles far
more complex queries for me everyday with hardly a murmer..



view thread (11+ messages)  latest in thread

Message-ID: <dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.com>
Permalink:  ../dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@gmail.com, emilu@encs.concordia.ca, rabroersma@yahoo.com
  Subject: Re: Get the max(value1, value2, value3) from a table
  In-Reply-To: <dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.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