Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ROWNUM question??
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)
--