Report: sources with citation frequency and number of cited persons, ordered by frequency of people

From TNG_Wiki
Jump to navigation Jump to search

Description: sources with citation frequency and number of cited persons, ordered by the frequency of people

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 s.sourceID AS Source_nr, s.title AS Long_title, s.shorttitle AS Short_title, s.author AS author_, s.publisher AS publisher_, s.comments AS Comments_, COUNT(*) AS Number_of_citations, COUNT(DISTINCT p.personID) AS Number_of_people FROM tng_sources AS s LEFT JOIN tng_citations AS c ON (s.sourceID=c.sourceID AND s.gedcom=c.gedcom) LEFT JOIN tng_people AS p ON (c.persfamID=p.personID AND c.gedcom=p.gedcom) GROUP BY s.sourceID ORDER BY Number_of_people DESC, CAST(SUBSTRING(s.sourceID, 2) AS UNSIGNED)