GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  Basics

 Print  |  
Question:  Create a report for the HR department that displays employee last names, department numbers, and all the employees who work in the same department as a given employee. Give each column an appropriate label.



December 12, 2008 01:21:20 #3
 kenito   Member Since: July 2008    Total Comments: 1 

RE: Create a report for the HR department that displays employee last names, department numbers, and all the employees who work in the same department as a given employee. Give each column an appropriate label.
 
select
    e.department_id department,
    e.last_name employee,
    c.last_name colleague
from
    employees e,
    employees c
where
    e.department_id = c.department_id
and
    e.last_name <> c.last_name;
     

 

Back To Question