I have two tables listing the member of a family and their relationships:
MEMBERS
EMP_ID Name
1 Great Grand Father
2 Grand Father
3 Father
4 Child1
5 Child2
RELATIONSHIP
MEM_ID PAR_MEM_ID
5 3
4 3
3 2
2 1
Now I want result as below:
G.G. Father Grand Father Father Child1
G.G. Father Grand Father Father Child2