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: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 28 Mar 2001 20:49:51 -0800
Message-ID: <3AC2BEEF.894F7A6A@exesolutions.com>

> 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 - 22:49:51 CST

Original text of this message

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