SELECT person.pid,
fname,
lname,
mumoi
 FROM person
INNER JOIN personchronic ON person.pid=personchronic.pid
INNER JOIN visit on person.pid=visit.pid
WHERE visitdate BETWEEN '2015-05-01' AND '2015-09-30'
GROUP BY person.pid;