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: ROWNUM, order by

Re: ROWNUM, order by

From: TurkBear <johng_at_mm.com>
Date: Wed, 20 May 1998 20:29:51 GMT
Message-ID: <35653cb3.6756525@news2.mm.com>


True enough, but you can get the same effect that you wanted with:

select * from myview where rownum < 16
MINUS
select * from myview where rownum < 10

this will return rownum 10 11 12 13 14 15

SET operators can sometimes do the impossible...

Hope it helps,
John Greco

Brett Neumeier <random_at_enteract.com> wrote:

>> If I want rows 10-15 as above and I do:
>> select * from myview where rownum > 9 and rownum < 16;
>> I always get "no rows selected". WHY? [...]
>
>ROWNUM is assigned to records that fulfill the entire WHERE
>clause.
>
>The first record that fulfills the WHERE clause gets rownum 1,
>and so on.
>
>If the where clause specifies that the rownum must be greater
>than 1, the where clause will never be fulfilled. Oracle
>realizes this and doesn't bother to perform the query.
>
>This is logically equivalent to specifying "where 1=2" or similar
>contradictory clauses.
>
>-bn
>
Received on Wed May 20 1998 - 15:29:51 CDT

Original text of this message

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