select patient_hn,cid,concat(pname,fname," ",lname)as pat,birthdate,h.address,v.village_moo from person p
inner join house h on h.house_id=p.house_id
inner join village v on v.village_id=h.village_id
where birthdate <"1955-08-01" and death <>"Y" and house_regist_type_id in ("1","3") and v.village_moo <>"0"
and person_id not in
(select person_id from person_vaccine_list pp inner join person_vaccine p on p.person_vaccine_id=pp.person_vaccine_id
and p.export_vaccine_code ="815" and pp.vaccine_date >"2013-09-30")
order by v.village_moo,h.address*1