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: FIRST_ROWS(n) with nested queries

Re: FIRST_ROWS(n) with nested queries

From: srivenu <srivenu_at_hotmail.com>
Date: 9 Feb 2004 03:21:40 -0800
Message-ID: <1a68177.0402090321.71432a2@posting.google.com>


You have to use the FIRST_ROWS(20) hint in the sub-query.

I.e Your query should look like this
SELECT order_id
FROM (SELECT /*+ FIRST_ROWS(20) */ o.*, r.name

      FROM FTGO_ORDER o, FTGO_RESTAURANT r 
      WHERE o.RESTAURANT_ID = r.RESTAURANT_ID ORDER BY o.ORDER_EXT_ID
DESC ) WHERE ROWNUM < 21;

regards
Srivenu Received on Mon Feb 09 2004 - 05:21:40 CST

Original text of this message

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