I have a table with an id and parentID each row have parentID that exist in the same table so the rows are connected and the most primordial row have parentID = 0 how can i get all the rows that are connected to each other in one call of sql?
so i wont have to request in a loop in the client side?
[edit]
it's kinda like a famliy tree
i have
id
name
parentID
so let say Adam is the grandfather Dan is his son and jack is his grandson
1 Adam 0
2 Dan 1
3 Jack 2
and i only have Jack's ID I want to get them all in one query can it be done?
tnx Ali