September 4, 2017 at 9:10 am
Hi
I have a requirement where I need to get employees managers up to 3 levels.
(Example : A(Employee) -> B(Manager 1) -> C(Manager 2))
Appreciate help.
Thanks,
Abhas
September 4, 2017 at 9:13 am
abhas - Monday, September 4, 2017 9:10 AMHi
I have a requirement where I need to get employees managers up to 3 levels.
(Example : A(Employee) -> B(Manager 1) -> C(Manager 2))
Appreciate help.
Thanks,
Abhas
What do you want for CEO level or people who don't have 3 levels?
What have you tried so far? Do you have a test harness of sample data and code you have tried you can share so our code is meaningful to your data.
September 4, 2017 at 9:51 am
abhas - Monday, September 4, 2017 9:10 AMHi
I have a requirement where I need to get employees managers up to 3 levels.
(Example : A(Employee) -> B(Manager 1) -> C(Manager 2))
Appreciate help.
Thanks,
Abhas
You've given us mostly nothing to go on. What is the structure of the tables? What are the keys that uniquely identify the rows? And why, for goodness sake, have the designers of these tables complicated things by putting them into more than one table instead of an easy to use and maintain single table Adjacency List?
Please see the first link under "Helpful Links" in my signature line below if you want coded help. If not, then the answer is to just join the tables on the appropriate keys.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 7, 2017 at 10:06 am
Assuming all employees are in the same table and have a parent_ID field to point up the tree then you are probably looking at a recursive CTE
You will find loads of examples on these boards and the wider internet
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply