จำนวนผู้ป่วยโรคเบาหวาน select count(distinct(v.hn))
from ovst v
left outer join pttype p on p.pttype=v.pttype
where (hn in (select hn from clinicmember where clinic="001"))
and vstdate between "2010-01-01" and "2010-01-31"
เบาหวานที่ไม่เป็นความดันselect count(distinct(v.hn))
from ovst v
left outer join pttype p on p.pttype=v.pttype
where (hn in (select hn from clinicmember where clinic="001"))
and v.hn not in (select hn from clinicmember where clinic="002")
and vstdate between "2010-01-01" and "2010-01-31"
จำนวนผู้ป่วยโรคความดันอย่างเดียวselect count(distinct(v.hn))
from ovst v
left outer join pttype p on p.pttype=v.pttype
where (v.hn in (select hn from clinicmember where clinic="002"))
and v.hn not in (select hn from clinicmember where clinic="001")
and (vstdate between "2010-01-01" and "2010-01-31")