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.

Showing Answers 1 - 12 of 12 Answers

Say for ex: Emp data in Table 1 and Dept Name in Table 2.

Now to get a report on employees department wise, make a script of filtering data where the employee and his dept is xxxxxx from Table 1 making base  dept from Table 2. Similarly the other way also the report can be taken maximum number of employees in a particular department also.

Srinivas

  Was this answer useful?  Yes

kenito

  • Dec 14th, 2008
 

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;

  Was this answer useful?  Yes

justgeek

  • Jan 10th, 2009
 

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

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions