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: select limit of returned rows

Re: select limit of returned rows

From: Sergey Gerasimov <gsa_at_baltros.ru>
Date: Mon, 23 Jul 2001 18:16:19 +0400
Message-ID: <3b5c3317@ns.baltros.ru>

> How about
> WHERE rownum > 19 AND rownum < 41

Conditions testing for ROWNUM values greater than a positive integer are always false. For example, this query returns no rows:

SELECT * FROM emp

    WHERE ROWNUM > 1; The first row fetched is assigned a ROWNUM of 1 and makes the condition false. The second row to be fetched is now the first row and is also assigned a ROWNUM of 1 and makes the condition false. All rows subsequently fail to satisfy the condition, so no rows are returned.

I think

select * from

   (SELECT emp.*, ROWNUM FROM emp where rownum < 41)    where ROWNUM>19 ;

HTH Best regards
Sergey Gerasimov
gsa_at_baltros.ru Received on Mon Jul 23 2001 - 09:16:19 CDT

Original text of this message

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