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: extract Top Ten order by date

Re: extract Top Ten order by date

From: Ed Prochak <ed.prochak_at_magicinterface.com>
Date: 26 Sep 2005 14:00:33 -0700
Message-ID: <1127768432.996018.140970@f14g2000cwb.googlegroups.com>

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

Original text of this message

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