Outer join

Hello

After executing the following query:

Select e.deptartment _id EMP,d.department_id DEPT
from employee e, department d
where e.department_id(+) = d.department_id

I get:
------------------------------------------------------
|EMP                                     DEPT               |
------------------------------------------------------
 |                                          Contracting     |
------------------------------------------------------

I need the same results to be produced WITHOUT using the outer join

Thanks
devguru001DevAsked:
Who is Participating?
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
The only way to achieve that without using an outer join is by UNION:
Select e.deptartment _id EMP,d.department_id DEPT
from employee e, department d
where e.department_id = d.department_id
UNION ALL
Select NULL,d.department_id 
from department d
where not exists (select * from employee e where e.department_id = d.department_id)

Open in new window

0
 
devguru001DevAuthor Commented:
Good answer!!!!  Thanks for the quick response....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.