I got a table with the user name and their guarantor. I want to select the record based on 1 name and follow by the guarantor and continue search next record based on this guarantor's guarantor.
=========================
Name | ParentName
=========================
Ali | Abu
Bola | Ali
Cat | Bola
Danny | Cat
Dog | Elephant
=========================
When I put in Danny to the parameter, my expected result will be :
=========
Name
=========
Danny
Cat
Bola
Ali
=========
Is there any possibility to done it with query?