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: Apparently anomalous behaviour with a subquery - has anyone seen this?

Re: Apparently anomalous behaviour with a subquery - has anyone seen this?

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Wed, 10 Jul 2002 16:32:17 +1000
Message-ID: <erQW8.31783$Hj3.96333@newsfeeds.bigpond.com>


Hi Sybrand,

In Galen's example, where does Oracle define it's value of var ?

var is *not* a column in the T2 table, so Oracle can't reference it from within the subquery.

var *is* a column in the T1 column, so it can reference it from the outer query.

The inner query is hence referencing a column from the outer query to create an equivalent predicate to 'where t1.id in (select t1.var from t2)'; (which is always false with this lack of data).

Therefore the subquery is referencing the outer query therefore this is an example of a correlated subquery ?

I'm beginning to get confused now :)

Regards

Richard
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message news:tnfniu4u5rpn5g2klq2so5h57e89sv4hde_at_4ax.com...
> On 9 Jul 2002 22:03:23 -0500, Galen Boyer <galenboyer_at_hotpop.com>
> wrote:
>
> >So, you are saying I can do a correlated subquery with that syntax?
> >That's actually sort of cool.
> Your query is NOT a correlated query.
> A correlated subquery refers in the subquery block to the main query
> block.
> This is confusion the OP brought in.
>
> Regards
>
>
> Sybrand Bakker, Senior Oracle DBA
>
> To reply remove -verwijderdit from my e-mail address
Received on Wed Jul 10 2002 - 01:32:17 CDT

Original text of this message

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