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: can I join 2 tables in PL/SQL??

Re: can I join 2 tables in PL/SQL??

From: <_at_hotmail.com>
Date: Thu, 29 Mar 2001 05:16:14 GMT
Message-ID: <3AC2730E.4E3AD5AC@hotmail.com>

I have the Oracle8 PL/SQL Programming (S.URman) book but I did not find any examples of 2 tables being joined inside a PL/SQL block.

"Daniel A. Morgan" wrote:

> > I created two PL/SQL tables of EMP, DEPT.
> >
> > Now I want to create a join of EMP.DEPTNO=DEPT.DEPTNO
> >
> > Where do I do this? Can I do a PL/SQL join at all?
> >
> > Basically, I want to select those fields from DEPT which have the same
> > DEPTNO as in EMP.DEPTNO.
>
> You definitely need to get yourself a PL/SQL book with examples. This
> group is not a replacement for reading.
>
> But for now ...
>
> SELECT e.field, d.field
> FROM emp e, dept d
> WHERE e.deptno = d.deptno
>
> will do the trick.
>
> Daniel A. Morgan
Received on Wed Mar 28 2001 - 23:16:14 CST

Original text of this message

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