Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Retrive a set of tuple

Re: Retrive a set of tuple

From: Eugenio <eugenio.spadafora_nospam_at_compaq.com>
Date: 2000/07/05
Message-ID: <8jut4q$93h$1@mailint03.im.hou.compaq.com>#1/1

You should use the Thomas's query because ROWNUM is a pseudo-column populated during the query itself.

ROWNUM means "Seq. Number of the retrieved row" but if you specify ROWNUM>XXX, that condition will always fail (row 1 doesn't satisfy ROWNUM>XXX; there is no row 2 without row 1 ;) Using the Thomas's query the pseudo-col is generated for the subquery and you can apply filters on it (renamed to avoid scope conflict with ROWNUM related to external query).

If you need to order the rows by some fields you can use in 8i

   (YOUR_QUERY_GOES_HERE)
can have order by clause
In releases prior to 8i you can only simulate an ascendant sort using group by in

   (YOUR_QUERY_GOES_HERE) I hope that helps

--
be happy

Eugenio
remove _nospam from reply address

Opinions are mine and do not necessarily reflect those of my company

=======================================================
Simone Celli_Marchi wrote in message <8jtaf3$8vf$1_at_le.cs.unibo.it>...

>Thomas J. Kyte <tkyte_at_us.oracle.com> wrote:
>>> I looking for a method to retrive a set of tuples from a table. For
example
>>> I want to retrive from the 15th to 30th tuple without the need to
keep in
>>> memory all tuples e select them from my cgi.

>> select *
>> from ( select rownum r, a.*
>> from (YOUR_QUERY_GOES_HERE) a
>> where rownum <= :MAX_ROW )
>> where r >= :MIN_ROW
>> /
>
>Before your mail, I found NUMROW, so now I do
>SELECT * from my_table where NUMROW>start_row AND NUMROW<end_row;
>
>Why should I use your query? Where is the difference?
>
>Thank you.
>
>--
>SysAdm on cantina.students.cs.unibo.it
>Undergraduate student of Computer Science
>http://caristudenti.cs.unibo.it/~celli
>Key fingerprint = D8BD F3D0 00A5 9C96 4A07 DE62 2A4C EDE1 06AA E5BC
>
Received on Wed Jul 05 2000 - 00:00:00 CDT

Original text of this message

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