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: Chris Richardson <cer_at_acm.org>
Date: 10 Feb 2004 14:07:53 -0800
Message-ID: <ae723b11.0402101407.76c53941@posting.google.com>


srivenu_at_hotmail.com (srivenu) wrote in message news:<1a68177.0402090321.71432a2_at_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;
>
>

This doesn't work either. It still uses the HASH JOIN based plan. Received on Tue Feb 10 2004 - 16:07:53 CST

Original text of this message

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