I have a table :
id type_name type_reportToId
1 Administrator 0
2 Guest GUEST 1
3 Landlord 1
4 Property Manager 3
13 Manager Manager 3
14 Asst. Property Manager 13
I need a result of "report to hierarchy" for id No 14. eg: id 14 has to report 13,13 has to report 3,3 has to report 1 ...like wise. I need a query for that in mysql. Can anybody help me ?