Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Query Question: Returning only subset of rows based on rownum
I have an internet application which displays the results of a query in
a table. Because I'm concerned about performance, I would like to limit
the number of rows returned per page. After a user saw, say, the first
50, he/she could click on a link to get the next 50. I thought this
would be easy by using the following syntax:
select col1,col2... from orders where condition1 and condition2 and (rownum > x) and (rownum < y)
where x and y are two values I would calculate. This works fine for >0 and <51. However, for any values other than 0 for the min, I get no rows back.
Does anyone have any suggestions on how to get this idea to work? Maybe there's a better way? I'd appreciate any help.
Thanks,
Ben Geyer
Caterpillar, Inc.
geyer_ben_a_at_cat.com
Received on Fri Aug 14 1998 - 14:43:56 CDT
![]() |
![]() |