Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: select at offset
The only method I know is really ugly and requires repeated queries of the
entire table (or tables) unless you wish to pack the result set into an
array, a PL/SQL table, or some other similar structure.
Here it is:
SELECT *
FROM (
SELECT field1, field2, field3, rownum FETCHEDROW
FROM mytable)
WHERE fetchedrow BETWEEN x and y;
If you load the results into something else you would just use the select that forms the in-line view and then select from that again and again and again and again.
Daniel Morgan
Matthias Leonhardt wrote:
> Hi freaks,
>
> I want select some rows of a table and "scroll" through the db like this:
>
> while (select next 5 elements) do write elementblock
> that means I need a select - statement which gets a number of rows at a
> given offset of the db (including getting previous 5 elements)
> select * (10-14) of mytable; to get row 10-14 of the table;
>
> how can I query this in oracle?
>
> thanks for Your help!
>
> bye,
> Matthias Leonhardt
Received on Tue Apr 16 2002 - 10:06:54 CDT