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: returning rows between two positions in a large query

Re: returning rows between two positions in a large query

From: Vincent Lemaire <v.Lemaire_at_kheops.com>
Date: Tue, 22 Jun 1999 10:09:14 +0200
Message-ID: <7kngai$brq$1@minus.oleane.net>

Y2K a écrit dans le message <376f8518.248375575_at_news.concentric.net>...
>I have a large select query that returns rows from a table in
>different sort orders depending on user inputs, and I wonder if there
>is any way to return just the rows between two specified positions?
>
>For example, let's say the query returns 2000 rows (in different
>orders depending on user input), and I only want 50 rows from #150 to
>#199.
>
>An analogy would be when you go to yahoo and do a search, and the
>results are broken down into various pages. I want to do the same
>thing in my web app.
>
>TIA!
maybe you should try with the rowid pseudo-column, if you don t mind of doing something specific to Oracle :

select * from your_table where substr (rowidtochar (rowid),10,4) between the_first and the_last;

where the_first and the_last are char - varchar2 - datatype, representing in hexadecimal format the scope of your query those must be exactly 4 characters length, while it is an alphanumeric comparison

example :

select * from your_table where substr (rowidtochar (rowid),10,4) between '0000' and '00B2'; Received on Tue Jun 22 1999 - 03:09:14 CDT

Original text of this message

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