Forum Discussion
rpaterson
12 years agoContributor
Hi Madeline,
You've got the right idea - the information you want is in the GroupAncestry table. The exact name of the table varies by your database back-end. Just use your database's admin UI to inspect the schema - it's in there!
The GroupAncestry table has two columns: ancestorId, descendantId. Both of the columns store IDs of groups as listed in the GroupDescription table. For the purposes of the GroupAncestry table every group is considered to be it's own ancestor and descendant. In other words if all your groups were unrelated (the group hierarchy was "flat") there would be one row in the GroupAncestry table for every group.
Examples:
Find every group that is a descendant of an ancestor group id 12345 (note the result includes the ancestor group itself):
select groupancestry_descendantid from groupancestry where groupancestry_ancestorid = 12345
Find every group that is an ancestor of a descendant group ID 6789 (note the result incudes the descendant group itself):
select groupancestry_ancestorid from groupancestry where groupancestry_descendantid = 6789
Regards,
Roy
You've got the right idea - the information you want is in the GroupAncestry table. The exact name of the table varies by your database back-end. Just use your database's admin UI to inspect the schema - it's in there!
The GroupAncestry table has two columns: ancestorId, descendantId. Both of the columns store IDs of groups as listed in the GroupDescription table. For the purposes of the GroupAncestry table every group is considered to be it's own ancestor and descendant. In other words if all your groups were unrelated (the group hierarchy was "flat") there would be one row in the GroupAncestry table for every group.
Examples:
Find every group that is a descendant of an ancestor group id 12345 (note the result includes the ancestor group itself):
select groupancestry_descendantid from groupancestry where groupancestry_ancestorid = 12345
Find every group that is an ancestor of a descendant group ID 6789 (note the result incudes the descendant group itself):
select groupancestry_ancestorid from groupancestry where groupancestry_descendantid = 6789
Regards,
Roy
Related Content
- 8 months agobleahy
- 2 months agoStoplight
- 2 months agoStoplight
- 3 years agogeneticmaterial