select v.pttype ,p.name ,count(v.vn) as amount ,count(distinct v.hn) as hn ,sum(v.income) as total
from vn_stat v
left join pttype p on p.pttype =v.pttype
where v.vstdate between "2007-10-30" and "2008-03-08" and p.pttype in ( "12","23",)
group by p.pttype
ลองดูนะครับ