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

Re: Oracle SELECT statement for SPECIFIC row?

From: TurkBear <johng_at_mm.com>
Date: Fri, 10 Mar 2000 19:43:48 GMT
Message-ID: <38c94fa5.6078230@204.181.81.99>

Rownum can only be used with = or < operators due to how is it computed ( actually due to when it is assigned by Oracle - it is NOT in the database )

You could add a field to the table and assign it a sequence number which you could then use to do what you want...Otherwise you may have to use Pl/Sql and a counter variable to do it...  

jmckwood_at_my-deja.com wrote:

>
>
>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.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =----- Received on Fri Mar 10 2000 - 13:43:48 CST

Original text of this message

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