Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Apparently anomalous behaviour with a subquery - has anyone seen this?
On Thu, 11 Jul 2002, richard.foote_at_bigpond.com wrote:
> Hey Galen, don't go and doubt me now, we're almost there buddy
> !!
Throw me a rope!
> This is not a good example as it makes no sense to write it as
> it has been.
>
> But if you agree that the var column in the subquery represents
> the var in T1 in the outer query,
Yes.
> which occurrence of var are we talking about. The answer is
> *the current one* as being processed in the outer query.
>
> Therefore we must execute the subquery checking for the current
> value of var for as many rows as we process in the outer
> query.
This is what doesn't make any sense. As you do the T1 subquery, you CAN'T look for values of var, cause var doesn't exist in T2.
> A correlated subquery !! If there were 10 rows in T1, the
> subquery would be executed 10 times. The execution plans and
> stats would confirm this.
I understand a correlated subquery, I just don't understand this particular one.
> I noticed a posting by Tom Kyte in this tread. He points to a
> very similar example in his link.
Haven't read his particular example.
Guess I'll go do that soon.
-- Galen BoyerReceived on Thu Jul 11 2002 - 09:57:05 CDT