SELECT house.villcode,
SUM(CASE WHEN person.typelive in ('1','3') THEN 1 ELSE '' END)AS 'พิการ'
FROM person 
INNER JOIN personunable ON person.pid = personunable.pid
INNER JOIN house ON person.pcucodeperson = house.pcucode AND person.hcode = house.hcode
INNER JOIN village ON house.pcucode = village.pcucode AND village.villcode = house.villcode
group by house.villcode
UNION
SELECT 'รวม ',
SUM(CASE WHEN person.typelive in ('1','3') THEN 1 ELSE '' END) AS 'พิการ'
FROM person 
INNER JOIN personunable ON person.pid = personunable.pid
INNER JOIN house ON person.pcucodeperson = house.pcucode AND person.hcode = house.hcode
INNER JOIN village ON house.pcucode = village.pcucode AND village.villcode = house.villcode;