I need to keep the family (i.e. some children of the parent. These children have their children, etc.)
So, I created a family of tables, which has the following structure
ID & baby nbsp; child_id parent_id
When I save a child, I save parent_id along with it.
Now,
when I want to get all the children of a given parent, I can easily do.
select child_id from family where parent_id = <given parent id>
But,
Now I want to get a complete family (all descendants of this parent)
i.e.
I want to get all children that have a given parent_id + all children that are children of the selected children in the first request, etc.
Can someone help me?
It is also possible that it is better to save the data initially, so I can get it later. Can someone point out a better way?
source share