Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle SELECT statement for SPECIFIC row?
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