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
Paul Sandwell wrote:
<snip>
> 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;
>
<snip>
Paul,
I don't THINK you can use an order by clause in a subselect, so the
above won't work. I could be wrong, however.
--- Allen Kirby AT&T ITS Production Services akirby_at_att.com Alpharetta, GA.Received on Thu Jun 05 1997 - 00:00:00 CDT
![]() |
![]() |