Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: extract Top Ten order by date
Mark D Powell wrote:
> Marco, you only need one nested query in your example
>
> 1 select ename
> 2 from (select ename from emp order by ename)
> 3* where rownum = 1
> UT1 > /
>
> ENAME
> ----------
> ADAMS
>
> HTH -- Mark D Powell --
Or no subquery at all if you do it right by selecting the rows in the
application level.
e.g. in sqlplus
set PAUSE ON
set PAGESIZE 25
SELECT a.*
FROM intradoc.article a ORDER BY a.article_date ;
stop the query after the first screenful.
Do you really need to use the fake ROWNUM to control this? Use the cursor properly.
Ed
(ROWNUM is an abomination and should be banned)
Received on Mon Sep 26 2005 - 16:00:33 CDT
![]() |
![]() |