Report: Branches with number of associated individuals

From TNG_Wiki
Jump to navigation Jump to search

Description: Branches with number of associated individuals

Copy and paste the text between the lines into the reports section below "OR Leave Display, Criteria and Sort fields blank and enter direct SQL SELECT statement here:" and give it the title you think is appropriate

SELECT t.treename AS family_tree, t.description AS description_of_tree, bl.branch, b.description 
AS Branche_description, COUNT( * ) AS Total_people
FROM tng_branchelinks AS bl
INNER JOIN tng_branches AS b ON ( bl.branch = b.branch
AND bl.gedcom = b.gedcom )
INNER JOIN tng_trees AS t ON t.gedcom = b.gedcom
WHERE bl.persfamID LIKE "I%"
GROUP BY bl.branch
ORDER BY t.treename, branch;