Let's say I have the following table
User_ID Manager_ID
---------------------
Linda Jacob
Mark Linda
Kevin Linda
Steve Mark
John Kevin
Basically the requirement is to pull out all the managers as user_id, which you are looking for. So, for example, if I send to Linda, then it should return me:
'Mark', 'Kevin', 'Steve', 'John'
or if I send to Mark, then he should return me:
Steve
I heard about a recursive function, but I'm not sure how to do it. Any help would be greatly appreciated.
source
share