| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select all colums from a table wher X has its Maximum
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
|  |  |