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: Select First 500 Rows of a Table

Re: Select First 500 Rows of a Table

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Wed, 18 Aug 2004 08:15:30 -0700
Message-ID: <1092842179.38811@yasure>


Michael wrote:

> Hello all,
>
> Thanks for responding.
>
> It seems Oracle keeps track of records\rows internally using ROWNUM.
> So for all those in a simliar situation try something like this:
>
> SELECT * FROM mytable WHERE rownum <= 500
>
>
> -Michael

You are incorrect. Oracle does not keep track of row numbering internally and there is no such thing as ROWNUM. ROWNUM is assigned during a query and is wholly dependent upon the ordering created by the query.

If you think I'm wrong then by all means try this:

SELECT *
FROM all_objects
WHERE ROWNUM = 2;

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace 'x' with 'u' to respond)
Received on Wed Aug 18 2004 - 10:15:30 CDT

Original text of this message

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