Problem with oracle query

From: Piccinin Federico <pcfed90_at_hotmail.com>
Date: 3 Apr 2003 23:59:35 -0800
Message-ID: <c156dda0.0304032359.89fea5a_at_posting.google.com>


hello, i've a problem with this query

SELECT * FROM CLI , AIND , ARUB , CONTATTI,
(SELECT scclid_acli CLIENTE, scclid_aind INDIRIZZO, scclid_arub
RUBRICA, MAX(scclid) ESITO FROM CONTATTI, CLI

         WHERE sccldata >= to_date('25/03/2003', 'dd/mm/yyyy')
           AND sccldata < to_date('31/03/2003', 'dd/mm/yyyy')
           AND scclid_acli = acliid AND acliid_afil = 1
         GROUP BY scclid_acli, scclid_aind, scclid_arub)
 WHERE ACLIID = CLIENTE
   AND AINDID = INDIRIZZO

   AND ARUBID = RUBRICA
   AND SCCLID = ESITO
   AND ACLIID_AFIL = 1 The execution plan is incredible: oracle does't execute the query

(SELECT scclid_acli CLIENTE, scclid_aind INDIRIZZO, scclid_arub
RUBRICA, MAX(scclid) ESITO FROM CONTATTI, CLI

         WHERE sccldata >= to_date('25/03/2003', 'dd/mm/yyyy')
           AND sccldata < to_date('31/03/2003', 'dd/mm/yyyy')
           AND scclid_acli = acliid AND acliid_afil = 1
         GROUP BY scclid_acli, scclid_aind, scclid_arub)

for first and than use this as temporary table to join with other tables but make first the cartesian product of CLI , AIND , ARUB , CONTATTI and after
executes the query.

There is a method with hints or other to force first the execution of the subquery and after the join ??

Thanks

    Federico Received on Fri Apr 04 2003 - 09:59:35 CEST

Original text of this message