Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: returning rows between two positions in a large query
Good suggestion. I still have a concern on performance. How big
would the overhead be of creating temp tables each time a user goes
from one page of 50 records to another one? Would it scale to a large
number of users? I am new to Oracle, so pardon my naive questions.
Thanks!
On Tue, 22 Jun 1999 16:02:03 +0100, "Mark G" <mgumbs_at_nospam.hotmail.com> wrote:
>The suggested solutions are fine for simple queries but once you start doing
>sorts on the tables, as the original thread suggested, the rownum method may
>return unexpected results. Using rownum will return the stated amount of
>records but ONLY in the order which is stored in a table.
>
>e.g You couldn't do query to search on the top 2000 items, sort by
>occurence and then find all items between position 100 and 200.
>
>Combining all this, why don't you do your initial query, save it to a temp
>table in the order you want and then use the rownum method stated below
>based on the sorted temp table?
>
>Mark
>
>shiling_at_math.wayne.edu wrote in message <7ko40t$959$1_at_nnrp1.deja.com>...
>>The following example selects records between #3-#4.
>>
>>SQL> select * from t
>> 2 ;
>>
>>TDATE
>>---------
>>09-JAN-99
>>09-JAN-98
>>09-JAN-97
>>09-JAN-96
>>09-JAN-95
>>09-JAN-94
>>
>>6 rows selected.
>>
>>SQL> select * from t where rownum<=4
>> 2 minus
>> 3 select * from t where rownum<=2;
>>
>>TDATE
>>---------
>>09-JAN-96
>>09-JAN-97
>>
>>SQL>
>>
>>
>>Sent via Deja.com http://www.deja.com/
>>Share what you know. Learn what you don't.
>
Received on Wed Jun 23 1999 - 11:21:52 CDT
![]() |
![]() |