select count(distinct c.hn) 'Case'
,count(distinct if(s.do_eye_screen='Y',s.clinicmember_id,null)) 'Screen'
,count(distinct if(s.has_eye_cormobidity='Y',s.clinicmember_id,null)) 'Has'
from clinicmember c
left join clinicmember_cormobidity_screen s on s.clinicmember_id=c.clinicmember_id
and s.screen_date between '2012-10-1' and '2012-12-31'
where c.clinic in (002)
แน่ใจว่าคุณบันทึกของผู้ป่วยความดัน