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: Brett Neumeier <random_at_enteract.com>
Date: 20 May 1998 18:05:34 GMT
Message-ID: <6jv61e$o8q$2@eve.enteract.com>


> 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 - 13:05:34 CDT

Original text of this message

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