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.



January 01, 2009 12:44:43 #4
 justgeek   Member Since: January 2009    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.deptno, e.ename, e1.ename
from scott.emp e, scott.emp e1
where e.deptno=e1.deptno
and e.ename<>e1.ename
order by e.deptno,e.ename
     

 

Back To Question