From: Arvind Balraman <dnivra@ix.netcom.com>
Subject: Re: Nested Select and Joins
Date: 1998/03/03
Message-ID: <34FC9010.C8AD321D@ix.netcom.com>#1/1
Content-Transfer-Encoding: 7bit
References: <34FCAFD1.9CD@bellsouth.net>
Mime-Version: 1.0
To: ahairat@bellsouth.net
Content-Type: text/plain; charset=us-ascii
Organization: Netcom
X-NETCOM-Date: Tue Mar 03  8:25:51 PM PST 1998
Newsgroups: comp.databases.oracle.tools



Actually there are 5 types of select

simple select
=========
select *
   from emp

nested select or sub select
==================
select *
  from emp
 where deptno in (select *
                             from dept
                           where location='london');
the rdbms engine first evaluates the subquery first ie the dept query and
then the outer query ie the emp query

corelated sub-select
=============
select a.*
  from emp a
   where a.deptno in (select b.deptno
                                  from dept b
                                where a.dept_no = b.deptno)

in this case the inner query refers a column from the outer query and the
rdbms engine first evaluates the outer query
ie the emp query and the inner query(ie the dept query) later.



Ashish Kumar Hairat wrote:

> Can somebody tell me what is nested select and its advantages? and also
> what is the difference between outer join, inner join  and equi join?
>
> Thanks



--
Balaraman Arvind
151 Andrew Ave, Apt 215
Naugatuck, CT 06770

ph   -  (203)-723-1190(R)
     -  (203)-459-7502(O)

mail -  dnivra@ix.netcom.com (R)
        abalaram@oxhp.com    (O)




