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: Left Join query

Re: Left Join query

From: MarkP28665 <markp28665_at_aol.com>
Date: 1997/09/26
Message-ID: <19970926224901.SAA03045@ladder02.news.aol.com>#1/1

What is a left join anyway? Do you mean an outer join? Since you can switch the column names accross the equal signs at whim what is a left or right join.

You use the (+) sysbol to indicate to oracle to do an outer join example:

select a.*, b.*
from emp a, dept b
where a.dept_no = b.dept_no

would join each row of the employee (emp) table to the matching rows of the department (dept) table where the department numbers are equal. If I had some departments with no employees assigned to them I could retrieve them also by

select e.*, d.*
from emp e, dept b
where e.dept_no(+) = d.dept_no

The plus sign goes on the table without the matching record if I remember correctly. This is pretty easy to test for yourself.

Mark Powell -- The only advise that counts is the advise that you follow so follow your own advise Received on Fri Sep 26 1997 - 00:00:00 CDT

Original text of this message

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