I have a table with employee ids and their manager ids. I want to get all their immediate reporting managers ids for that employee. I have used the connect by function. But its showing all the mangers like if the emp A reports to Mgr A and Mgr A reports to Mgr B. say if Mgr A also reports to Mgr C, then my current query retrieves all the Mgrs (A,B and C) but i need only Mgr A and B. Kindly help me here.

Question asked by visitor Suresh