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

Home -> Community -> Usenet -> c.d.o.server -> Re: ROWNUM question??

Re: ROWNUM question??

From: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: Wed, 20 Jan 1999 16:51:41 +0800
Message-ID: <36A5991D.4D66@bhp.com.au>


Oscar Paredes wrote:
>
> Hi all!
>
> I want to select the first row of a SELECT statement
> that have a ORDER BY, like:
>
> select e.name
> from employee e
> where rownum=1
> order by e.name
>
> But,... unfortunatelly... this don't work!! :-(
>
> Someone know how to do this????
>
> Thanks,
> Oscar

Check the post by DeVerne Coleman...
If you don't have index you need something like:

select blah
from my_table t
where 1 < ( select count(*)

             from my_table
             where blah > t.blah)


--



Connor McDonald
BHP Information Technology
Perth, Western Australia
"The difference between me and a madman is that I am not mad" Received on Wed Jan 20 1999 - 02:51:41 CST

Original text of this message

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