Report: Couples having the same names

From TNG_Wiki
Jump to navigation Jump to search

Description: Couples having the same names


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 familyID, h.personID AS HusbandPersonID, h.lastname AS Lastname1, h.firstname 
AS Firstname1, w.personID AS WifePersonID, w.lastname AS Lastname2, w.firstname 
AS Firstname2, f.living, f.gedcom FROM tng_families AS f LEFT JOIN tng_people 
AS h ON (f.husband=h.personID AND f.gedcom=h.gedcom) LEFT JOIN tng_people 
AS w ON (f.wife=w.personID AND f.gedcom=w.gedcom) 
WHERE (h.lastname=w.lastname) and (h.firstname=w.firstname) 
ORDER BY h.lastname, h.firstname, h.personID, w.firstname, w.lastname, w.personID