Dave Short Posted April 4, 2025 Report Share Posted April 4, 2025 I am trying to write a report which I will use to compare the trees on TNG with those on my my home database. My first attempt, which gives me most of the information I want is: "select gedcom,Treename,description,lastimportdate from tng_trees order by treename". However, I also want to know the number of people in each tree, and this works: "select gedcom as Tree, count(gedcom) as people from tng_people group by gedcom". But when I try to combine these statements, like: "select gedcom,Treename,description,lastimportdate, (count(gedcom) as people from tng_people where tng_people.gedcom=tng_trees.gedcom ) from tng_trees order by treename" I get something which times out before it can produce an answer. Any ideas, please? Quote Link to comment Share on other sites More sharing options...
Leif Sweden Posted April 4, 2025 Report Share Posted April 4, 2025 Hi Dave, I am not sure if I can help you but first some questions: which version of TNG do you use? how many trees do you have in your base? You can get information about number of persons and other information per tree or all together inside TNG but I don´t know if that is what you are looking for. I have 13 trees at my site and I can do that inside TNG, Leif Quote Link to comment Share on other sites More sharing options...
GOGGS Posted April 4, 2025 Report Share Posted April 4, 2025 Try this: select t.gedcom, t.description, treename, lastimportdate, count(personid) as numpeople from tng_people p inner join tng_trees t on p.gedcom = t.gedcom group by t.gedcom; Cheers GOGGS Quote Link to comment Share on other sites More sharing options...
Ken Roy Posted April 4, 2025 Report Share Posted April 4, 2025 10 hours ago, Dave Short said: I also want to know the number of people in each tree, Does the TNG Info > Trees (browsetrees.php) not provide the information you are looking for Quote Link to comment Share on other sites More sharing options...
Dave Short Posted April 5, 2025 Author Report Share Posted April 5, 2025 Leif: I am using TNG v14, and have 283 trees at the moment, with more to come. Goggs: Yes, that does the trick! Thanks very much. Ken: Yes, but I want to download it in a file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.