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: mistake, error, or something else ?

Re: mistake, error, or something else ?

From: Rob Cowell <rjc4687_at_hotmail.com>
Date: Mon, 27 Oct 2003 14:32:44 +0000 (UTC)
Message-ID: <3F9D2C8B.AACA0C77@hotmail.com>

Rob Cowell wrote:
>
> Daniel Morgan wrote:
> >
> > mbrugo_at_despammed.com wrote:
> >
> > >Hi people.
> > >I've this query:
> > >
> > >select a,b,c from t1
> > >where c in (select distinct c from t2);
> > >
> > >
> > >this query run succesfully BUT:
> > >
> > >select distinct c from t2
> > >give me: ora-904 Invalid column name.
> > >
> > >WHY ????
> > >
> > >i've no synonym or other objects
> > >
> > >t1 has 3 columns, a,b,c
> > >t2 has 2 columns d,e
> > >
> > >Tia
> > >
> > >Mike
> > >
> > >
> > Which part of "t2 has 2 columns d,e" would lead you to believe that
> > "select distinct c from t2" would be successful?
> >
> > --
> > Daniel Morgan
>
> But it is 'sucessful'. Well it won't retrieve anything, but it's valid
> syntax.
>
> (select distinct c from t2)
>
> in this sub query is the same as
>
> (select distinct t1.c from t2)
>
> and that's legal, but fairly useless code.

Actually I think the subquery with return all distinct values for t1.c as many times as there are rows in t2.

I guess it's some weird ANSII compatibility thing? Received on Mon Oct 27 2003 - 08:32:44 CST

Original text of this message

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