Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Outer join

Posted on 2011-10-04
2
Medium Priority
?
458 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:devguru001
2 Comments
 
LVL 72

Accepted Solution

by:
Qlemo earned 500 total points
ID: 36908756
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
 

Author Closing Comment

by:devguru001
ID: 36908804
Good answer!!!!  Thanks for the quick response....
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question