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: Query Question: Returning only subset of rows based on rownum

Re: Query Question: Returning only subset of rows based on rownum

From: <nasof_at_hotmail.com>
Date: Sat, 15 Aug 1998 03:07:27 GMT
Message-ID: <6r2u1g$nml$1@nnrp1.dejanews.com>


We've all been caught by the rownum "gotcha" at one point or another. You can only use rownum for < or <= comparisons.

You might want to say what your "internet application" is written in if you want more feedback from the group about how to get around this...

-Frank

In article <35D4937C.C95A548B_at_cat.com>,   Ben Geyer <geyer_ben_a_at_cat.com> wrote:
> 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
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Fri Aug 14 1998 - 22:07:27 CDT

Original text of this message

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