select o.pttype,p.name,count(distinct s.person_anc_id) 'case',count(s.vn) 'total'
from person_anc_service s
left join ovst o on s.vn=o.vn
left join pttype p on p.pttype=o.pttype
where s.anc_service_date between '2011-1-1' and '2011-1-31'
group by o.pttype
order by o.pttype
แบบนี้มั๊ย