Solved: Oracle SQL, display colleagues who work in the same dept. as a given employee

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ElementOfMagic

Thread Starter
Joined
Dec 30, 2012
Messages
52

Hello. :)

I am currently working in Oracle SQL Developer and I need to create a report that displays employee last names, department ID's, and all the employees (under the name of "Colleagues") who work in the same department as a given employee.

This is what I have so far, it seems to be giving me an error at line 5 for some reason.

Code:
select
department_id AS dept_id,
department_name AS "Dept_Name",
last_name AS "Employee" from departments,
[COLOR="Red"]last_name AS "Colleague" from departments where department_id = '&department_id'[/COLOR]
natural join employees;
Any help/guidance would be appreciated. :)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top