Doh .... as the man would say.

Absolutely, how can you have a rownum > or directly equal to a number other
than 1 when by the very nature that can never happen.

If you say = 5 or > , it will never happen without the rest of the data
there to increment the rownum to 5.


-----Original Message-----
Sent: Wednesday, July 11, 2001 5:13 PM
To: Multiple recipients of list ORACLE-L


Rao,

This snippet from The Fine Manual explains it all... "= 5" or "> 1" will
return 0 rows:
--------------
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.
--------------

Jack

--------------------------------
Jack C. Applewhite
Database Administrator/Developer
OCP Oracle8 DBA
iNetProfit, Inc.
Austin, Texas
www.iNetProfit.com
[EMAIL PROTECTED]
(512)327-9068


-----Original Message-----
Maheswara
Sent: Wednesday, July 11, 2001 4:44 PM
To: Multiple recipients of list ORACLE-L


List,

Following are two SQL statements.  The first SQL statement works OK (where
ROWNUM < 5 is used). The second SQL statement does not return any rows
(where ROWNUM = 5 is used).  This table contains 200 records.

First SQL statement
-------------------
SELECT * FROM
  (SELECT PROCESSED_DATE
     FROM TRADES WHERE PROCESSED_STATUS = 0
          ORDER BY ENTRY_DATE)
  WHERE ROWNUM < 5

Second SQL statement
--------------------
SELECT * FROM
  (SELECT PROCESSED_DATE
     FROM TRADES WHERE PROCESSED_STATUS = 0
          ORDER BY ENTRY_DATE)
  WHERE ROWNUM = 5

---------------
Question:

Why second SQL statement does not work?

I would be thankful for the clarification.

Thanks,

Rao
[EMAIL PROTECTED]

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Rao, Maheswara
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jack C. Applewhite
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Kevin Lange
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to