Select person.pid,
concat(titlename,fname,' ',lname) as 'ชื่อ-สกุล',
getAgeMonth(birth,current_date) as 'อายุ',
villno as 'หมู่ที่',
house.hno as 'บ้านเลขที่',
villname as 'หมู่บ้าน'
from person
LEFT JOIN ctitle on person.prename = ctitle.titlecode
INNER JOIN house on person.pcucodeperson = house.pcucodeperson 
and person.hcode = house.hcode
LEFT JOIN persondeath ON person.pid = persondeath.pid
INNER JOIN village on house.villcode = village.villcode and villno <>'00'
WHERE getAgeMonth(person.birth,current_date) <= 71 
and nation = 99 
and person.typelive in ('1','3') 
AND persondeath.pid IS NULL
GROUP BY villno,hno,person.pid