ถ้าแบบนี้จำนวนครั้งจะถูกมั้ยฮะ
select pt.hn,concat(pt.pname,pt.fname,' ',pt.lname) as ptname , count(v.vn) as aa
from vn_stat ov ,patient pt ,ovst vt
where ov.vn=vt.vn and pt.hn=ov.hn and ov.vstdate between "2012-05-01" and "2012-05-31" and ov.hn=pt.hn
and ( (ov.pdx = "F123")
or (ov.dx0 = "F123")
or (ov.dx1 = "F123")
or (ov.dx2 = "F123")
or (ov.dx3 = "F123")
or (ov.dx4 = "F123")
or (ov.dx5 = "F123")
)
group by pt.hn
order by pt.hn