Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: can I join 2 tables in PL/SQL??
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