select v.hn,v.cid,concat(p.pname,p.fname," " ,p.lname) as pyname,v.pdx,v.age_y ,p.birthday,p.addrpart ,v.moopart,t.full_name ,ps.name ,p.death ,v.vn
from vn_stat v
left outer join patient p on p.hn=v.hn
left outer join pt_subtype ps on ps.pt_subtype=v.pt_subtype left outer join thaiaddress t on t.addressid = concat(p.chwpart,p.amppart,p.tmbpart)
where v.vstdate between "2012-09-01" and "2012-09-30" and v.pt_subtype="2"
group by v.vn
limit 2000