6 Replies Latest reply on Jan 23, 2015 4:21 AM by Anand Gupta

# Finding Manager- famous oracle question

Hi ,

there is a problem in my current project which looks like famous finding manager name .

have attached sheet too for reference.

Looks like easy solution but still not able to solve it.

Thanks!!!

• ###### 1. Re: Finding Manager- famous oracle question

Where are those names? Can't see them

• ###### 2. Re: Finding Manager- famous oracle question

I dint get you ... did you solved it ....

• ###### 3. Re: Finding Manager- famous oracle question

So do you have those Manager names somewhere as a list?

I just duplicated manager id and then edited alias for each id

• ###### 4. Re: Finding Manager- famous oracle question

for example :

If I look for Ankit Manager name .

Ankit's Manager ID is 3 and if we look for employee ID 3 then Employee name is Rajesh.

So Ankit Manager Name is : Rajesh.

Hope I am clear ?

• ###### 6. Re: Finding Manager- famous oracle question

Thanks for replying it solved my issue and saved my day !!

but the real problem for me was to calculate the "Expense" for Employees which is recursively calculated.

How to solve recursive problem.

for example :

Expense of Rajesh is : Expense of Rajesh + Expense of Employee for whom he is manager.(Recursively)

i.e.

Exp of Rajesh

= Expense of Rajesh + Expense of Anand + Expense of Ankit

= Expense of Rajesh + Expense of Anand + Expense of Ankit+ Expense of (Mr X + Mr Y)+ Expense of (Mr Z)

= 1000+100+200+10+20+5

=1335

Thanks!!!