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: How to limit the number of rows returned in a select statement

Re: How to limit the number of rows returned in a select statement

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1997/06/05
Message-ID: <33969962.14997778@www.sigov.si>#1/1

On Wed, 04 Jun 1997 11:39:45 -0500, Paul Sandwell <paul_sandwell_at_sdt.com> wrote:

>Depending on the reason you want to limit the number of rows returned,
>you can fudge it.
>
>If you want to see only a few rows because that gives whatever info you
>need and the query execution itself is not a matter of concern, then use
>your original SELECT statement as a subselect of an outer SELECT which
>limits on ROWNUM. Like this:
>
>SELECT * from (select X,Y from table_a order by Y) where rownum < 10;
>

I am affraid this won't work, because you can not use ORDER BY in a subquery!

Regards,


Jurij Modic                             Republic of Slovenia
tel: +386 61 178 55 14                  Ministry of Finance
fax: +386 61  21 45 84                  Zupanciceva 3
e-mail: jurij.modic_at_mf.sigov.mail.si Ljubljana 1000
Received on Thu Jun 05 1997 - 00:00:00 CDT

Original text of this message

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