Problem Statement :
We have teams organized in following was in database table: ID, PARENT_ID, TEAM_NAME
So there can be n levels using parent id, there is no fixed hierarchy with teams.
We have show report in pivot table like below
Team > team > team > Consultant
1) A team can be assigned to more than one Consultant, 2) A consultant will be assigned to only one Team. 3) A team can have many teams underneath
We have already got pivot working like Team -> Consultant
But it need to be Team -> Team -> Team.....-> Consultant