Re: Problem with oracle query

From: TurkBear <john.greco_at_dot.state.mn.us>
Date: Fri, 04 Apr 2003 09:48:30 -0600
Message-ID: <06ar8vcik5vf9a4jtqhj9huhrco52q8r60_at_4ax.com>


pcfed90_at_hotmail.com (Piccinin Federico) wrote:

>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

You do not appear to be providing the parser with any table linking information so it will do a cartesian join of the CLI,AIND,ARUB and CONTATTI - since it is not given any qualifying info...

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =--- Received on Fri Apr 04 2003 - 17:48:30 CEST

Original text of this message