ลองอันนี้ดูครับ
select distinct o.hn,p.pname,p.fname,p.lname,vs.age_y,p.moopart,p.tmbpart
from vn_stat vs
left outer join patient p on p.hn = vs.hn
where vs.vstdate between '2008-01-01' and '2008-05-10'
and p.moopart in ("4")
and p.tmbpart in ("01")
and ( (vs.pdx = "I10")
or (vs.dx0 = "I10")
or (vs.dx1 = "I10")
or (vs.dx2 = "I10")
or (vs.dx3 = "I10")
or (vs.dx4 = "I10")
or (vs.dx5 = "I10"))
group by o.hn,p.pname,p.fname,p.lname,vs.age_y,p.moopart,p.tmbpart