Home » Other » Training & Certification » employee supervisor relationship help please
employee supervisor relationship help please [message #317639] Fri, 02 May 2008 04:56 Go to next message
sunildatt_b
Messages: 3
Registered: May 2008
Junior Member
question
========
Due to a recent re-organization, the company needs a query to show who supervises each employee. The output should be sorted first by supervisor name and then by employee name within that.

SELECT E.EMP_NUM EMPLOYEE,
E.EMP_FIRST EMPLOYYENAME,
K.EMP_FIRST SUPERVISORNAME,
E.SUPERVISOR_ID
FROM EMPLOYEE E
INNER JOIN(SELECT
SUPERVISOR_ID,EMP_FIRST
FROM
EMPLOYEE
GROUP BY
SUPERVISOR_ID,EMP_FIRST) K ON
K.SUPERVISOR_ID=E.EMP_NUM

the output that i got is
=============
EMPLOYEE EMPLOYYENAME SUPERVISORNAME SUPERVISOR_ID
===============================================
E1112 Samules KARNVEO E1113
E1112 Samules KERVIN E1113
E1113 Blaine Samules E1114
E1114 KERVIN Blaine E1112

but the output should be like
====================
EMPLOYEE EMPLOYYENAME SUPERVISORNAME SUPERVISOR_ID
===============================================
E1112 Samules blaine E1113
E1112 Samules blaine E1113
E1113 Blaine kervin E1114
E1114 KERVIN Samules E1112

can any one help me reagrding this please
Re: employee supervisor relationship help please [message #317642 is a reply to message #317639] Fri, 02 May 2008 05:05 Go to previous message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is NOT an expert question.

It is clearly stated in the forum description: "Newbies should not post to this forum!"
Expert notion is defined in the sticky: Not an EXPERT? Post in the NEWBIES forum, NOT here
Expert notion is defined in the sticky: OraFAQ Forum Guide
Read them, follow them including what is said about formatting.

As you are an expert, I don't answer the question because you obviously already knows it.

Regards
Michel
Previous Topic: holding session
Next Topic: grouping the records problem help please
Goto Forum:
  


Current Time: Wed Apr 17 20:33:57 CDT 2024