Re: Get the max(value1, value2, value3) from a table - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Get the max(value1, value2, value3) from a table
Date
Msg-id dcc563d10801071440x59211129r424238bc0dc5d697@mail.gmail.com
Whole thread Raw
In response to Re: Get the max(value1, value2, value3) from a table  (Emi Lu <emilu@encs.concordia.ca>)
List pgsql-sql
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..


pgsql-sql by date:

Previous
From: Josh Williams
Date:
Subject: Re: Get the max(value1, value2, value3) from a table
Next
From: "Scott Marlowe"
Date:
Subject: Re: Get the max(value1, value2, value3) from a table