Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to limit the number of rows returned in a select statement
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 3e-mail: jurij.modic_at_mf.sigov.mail.si Ljubljana 1000
![]() |
![]() |