Report: People without a default image

From TNG_Wiki
Jump to navigation Jump to search

Description: People without a default image

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 lastname, firstname, personid, gedcom FROM ( SELECT p.lastname, p.firstname, p.personid, p.gedcom, MAX(ml.defphoto) AS mdp, COUNT(ml.medialinkid) AS n FROM tng_people AS p, tng_medialinks AS ml, tng_media AS m WHERE ml.personid = p.personid AND ml.gedcom = p.gedcom and ml.mediaid = m.mediaid AND m.gedcom = p.gedcom AND m.mediatypeid = 'photos' GROUP BY p.personid ) AS tmp WHERE n > 0 AND mdp != 1