Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: subqueries in from clause

Re: subqueries in from clause

From: Murf <smurphy_at_triad.rr.com>
Date: Wed, 27 Dec 2000 21:50:17 GMT
Message-ID: <92do6m$vlm$1@nnrp1.deja.com>

Your "timing" is off with your naming. In the 6th line, you refer to COMPANY, which is also referred to in the first line, but renamed SELF. Can you be a little more clear with your table-naming? Because it's just not going to work with your example having two tables with the same name.

Or are you trying to refer to two tables with the same name in different databases??
-Murf

In article <3A3F7F90.9572D22F_at_inf.tu-dresden.de>,   Sten Loecher <sl13_at_inf.tu-dresden.de> wrote:
> Hi all,
>
> I tried to make a query like this:
>
> select * from COMPANY SELF
> where exists
> (select PID from
> (select PID from PERSON where PID in
> (select PID from EMPLOYMENT where CID in
> (select CID from COMPANY where CID = SELF.CID))))
>
> (PID and CID are just some columns of the tables PERSON and COMPANY
> respectivly, EMPLOYMENT is an association table).
>
> Even if it might seem a little bit crazy to write a query like that, I
> really need to do it that way. So,
> I got the following error:
>
> (select CID from COMPANY where CID = SELF.CID))))
>
> *
> ERROR at line 6:
> ORA-00904: invalid column name
>
> Does anyone know about restrictions in subqueries performed in the
 from
> clause of some query. I could not find any Information in the
> documentation.
>
> Thanks for any help,
>
> Sten
>
> sl13_at_inf.tu-dresden.de
>
>

Sent via Deja.com
http://www.deja.com/ Received on Wed Dec 27 2000 - 15:50:17 CST

Original text of this message

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