Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: subqueries in from clause
At first sight it looks legal.
However, the word SELF falls into the
category of (I think) reserved words in
Oracle 8.1, perhaps the only thing you
need to do is change the table alias.
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison-Wesley See a first review at: http://www.ixora.com.au/resources/index.htm#practical_8i More reviews at: http://www.jlcomp.demon.co.uk/book_rev.html Sten Loecher wrote in message <3A3F7F90.9572D22F_at_inf.tu-dresden.de>...Received on Tue Dec 19 2000 - 13:34:28 CST
>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
>
>