Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Selecting a range of records

Re: Selecting a range of records

From: jabelsc_at_yahoo.com <(jabelsc_at_yahoo.com)>
Date: Wed, 11 Jul 2001 10:00:43 GMT
Message-ID: <3b4c2392.183325671@news.ericsson.se>

Thank you very much to all who have answered. Yes, it's tru what Galen says.

Regards.

        Abel
On 8 Jul 2001 14:02:01 -0500, Galen Boyer <galenboyer_at_hotpop.com> wrote:

>On Sun, 8 Jul 2001, gjlinker_at_oraxcel.com wrote:
>
>> You can execute e.g. select * from emp where rownum between 10
>> and 30. Note that you will get an arbitrary set of 20
>> records!. To be more precise use order by.
>
>It isn't as simple as this. A between is implicitly > x and < y.
>The > x will make the use of rownum not find anything.
>
>He needs to do what Tom Kyte posted in misc. His snippet was
>like this
>
>select ename, empno
>from ( select emp.* , rownum R
> from emp
> where rownum <= 10 )
> where r >= 5
>
>So, Abel would want to do
>
>select whatever.*
>from (select whatever.*, rownum R
> from whatever
> where rownum < 112)
>where R >= 32
>
>--
>Galen
>I don't want to be the rock. Yeah, okay, what do you want to be?
>I want to be the piece of glass.
  Received on Wed Jul 11 2001 - 05:00:43 CDT

Original text of this message

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