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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Reformat SQL Syntax to for a correlated SQL query?

Re: Reformat SQL Syntax to for a correlated SQL query?

From: Robert Schultz <sembiance_at_hotmail.com>
Date: 17 Jul 2003 10:41:10 -0700
Message-ID: <fd216888.0307170941.7bcbb95@posting.google.com>


andrewst <member14183_at_dbforums.com> wrote in message news:<3112862.1058285965_at_dbforums.com>...
> However, I suspect your problem comes from the fact that you can't
> correlate an in-line view. For example, you can't do this:
>
> select e.ename, v.dname
> from emp e,
> (select * from dept where dept.deptno = e.deptno) v
> where e.deptno = v.deptno

No views are involved.

Maybe I should simplify it better:
I'm doing something like this:

select e.ename, (select count(*) from dept where dep.deptno = e.deptno) theCout
from emp e

But I'm doing it more advanced, and several of them. It works fine as shown.

But, if the subselect itself contains ANOTHER subselect, which references a column from a table from the main first statement, then it gives an error.

See what I mean now? Received on Thu Jul 17 2003 - 12:41:10 CDT

Original text of this message

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