Lets 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 all the managers under the user_id you are searching for. So for instance if I send in 'Linda' then it should return me:
'Mark', 'Kevin', 'Steve', 'John'
or if I send in 'Mark' then it should return me:
Steve
I have heard of recursive function but I am unsure of how to do this. Any help would be appreciated.