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: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 19 Dec 2000 19:34:28 -0000
Message-ID: <977254520.25062.0.nnrp-14.9e984b29@news.demon.co.uk>

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>...

>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
>
>
Received on Tue Dec 19 2000 - 13:34:28 CST

Original text of this message

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