Hi,
I am trying to achieve the below requirement written the query like below
if i passed employee number then i need to get the final manager (ex. if i passed 00116 then i am looking 00334 as the manager, 00116 employee mgr have next next mgr). I am able to achieve that requirement with the below query, when i added the status also its traversing and giving result but it should not show traverse if the status is null
My requirement is if the status is A then only it need to be traverse and show the last manager details otherwise it should be anything, but in the below query it is not happening.
Emp MGR status
00008 00302 A
00116 00112
00112 00223 A
00223 00334 A
I have the data like below in a table
SELECT empno
FROM employees where status='A'
WHERE CONNECT_BY_ISLEAF = 1
START WITH empno = 00116
CONNECT BY empno = PRIOR mgr;