Interview Answer

Its better to wait for a productive programmer to become available than it is to wait for the first available programmer to become productive. Steve McConnell

Find manager for employee

April 12, 2016 7:26 pm

Comments



Find manager for employee



												desc HR.employees;
												
												Name           Null     Type         
												-------------- -------- ------------ 
												EMPLOYEE_ID    NOT NULL NUMBER(6)    
												FIRST_NAME              VARCHAR2(20) 
												LAST_NAME      NOT NULL VARCHAR2(25) 
												EMAIL          NOT NULL VARCHAR2(25) 
												PHONE_NUMBER            VARCHAR2(20) 
												HIRE_DATE      NOT NULL DATE         
												JOB_ID         NOT NULL VARCHAR2(10) 
												SALARY                  NUMBER(8,2)  
												COMMISSION_PCT          NUMBER(2,2)  
												MANAGER_ID              NUMBER(6)    
												DEPARTMENT_ID           NUMBER(4)   
												

Solution

   					 
												SELECT e.employee_id,e.manager_id FROM
													HR.employees e,HR.employees m
													WHERE e.manager_id=m.employee_id(+);
																    

Comments



Please login to add comments.