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 -> Oracle SELECT statement for SPECIFIC row?

Oracle SELECT statement for SPECIFIC row?

From: <jmckwood_at_my-deja.com>
Date: Fri, 10 Mar 2000 18:55:25 GMT
Message-ID: <8abger$rp7$1@nnrp1.deja.com>

Due to architectural limitations of the application, I need to be able to select individual rows in a database table, based on their "row number," preferably using the SELECT statement. How do I do this?

For example, if database table ACCOUNTS has 250 rows, e.g.

        select count(*) from ACCOUNTS == 250

I need to be able to do the following:

        for index = (1..250)
            select * from ACCOUNTS where ROWNUM = index

However, when I try this, the select statement works ONLY when rownum == 1. If I try rownum == 5 or any other value, I get nothing back.

Is there a way to retrieve SPECIFIC rows, by row number, without knowing the contents of each row?

Thanks for helping ...
Jim Wood
jmwood_at_unispheresolutions.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Mar 10 2000 - 12:55:25 CST

Original text of this message

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