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: 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: Allen Kirby <akirby_at_att.com>
Date: 1997/06/05
Message-ID: <3396C413.63C2@att.com>#1/1

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

Original text of this message

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