if my data structure is like this
parentA -------parentAA --------------parentAAA ---------------------childA
if i can get \"childA.name\" . h
You can use nested set model. Nested sets have big advantage that they can be implemented in most SQL engines using simple, non-recursive SQL queries.