Hi, I need to select full span of employees under a Manager, say if X is the manager, and A, B, C report to X, where A is also a manager and D, E, F report to A, Now I need to write a sql which gets manager name as the input, If I enter X as the manager name it should show A, B, C, D, E, F in the output. Please let me know how to achieve this. If you have any Sql pls share it. I need to use this in an SQR.
Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
If your database platform is oracle then you can use start with--connect by clause.
Here is sample SQL
SELECT emplid, supervisor_id
FROM ps_employees
START WITH supervisor_id = '1122456'
CONNECT BY PRIOR emplid = supervisor_id;
Regrads,
Rahul Khandelwal
here is a blog post that will explain what rahulkhandelw is talking about http://www.compshack.com/sql/start-with-and-connect-by-oracle-sql
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Thanks, this worked and its pretty simple to understand!!
How to use "connect by prior" to select value from Job table based on effective date or let me know how to give effective date condition in the above mentioned sql