Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Select all colums from a table wher X has its Maximum

Re: Select all colums from a table wher X has its Maximum

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 19 Jul 2005 07:57:50 -0700
Message-ID: <1121785077.628267@yasure>


Björn Wächter wrote:
> Hi all,
>
> is there a way to select all columns from a table
> where for example comlum W has its maximum?
>
> Table A:
>
> W | X | Y |
> ------------
> 1 | 2 | 5 |
> 3 | 3 | 3 |
> 6 | 7 | 1 |
> 1 | 8 | 2 |
>
> What I do at the moment is:
>
> SELECT * FROM A
> WHERE W IN (SELECT MAX(W) FROM A)
>
> But is there a way with only one select statment?

What you wrote is one statement. If you are looking for something to do ... run an explain plan.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Tue Jul 19 2005 - 09:57:50 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US