Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get common data

user8012501Apr 23 2016 — edited Apr 25 2016

Hi Experts,

I want to write a query with joins as well as common data as well.

Usecase:

1. I have Employee, department and Location table. I want to get all department names associated to employee and along with in department there 2 common admin department which

i should always irrespective of the employee. Can any one help me to write this query.

Below query i can get all common data between all 3 tables, but how can i get the admin Department which doesn't have any relation in employee or location.

select Dept.DepartmentName where Employee emp, Department dept, Location loc

where dept.DepartmentId=emp.DepartmentId

and loc.DepartmentId=dept.DepartmentId .

Any inputs highly appreicate.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2016
Added on Apr 23 2016
7 comments
1,261 views