หรือจะลองแบบนี้มั๊ง
select ov.vstdate,count(op.hn) as hn
,sum(if(op.bpd>0,1,0)) as bpd
,sum(if(op.bps>0,1,0)) as pbs
,sum(if(op.bw>0,1,0)) as bw
,sum(if(op.pulse>0,1,0)) as pulse
,sum(if(op.temperature>0,1,0)) as temperature
from opdscreen op , ovst ov
where op.vstdate between "2007-08-01" and "2007-08-31" and op.vn = ov.vn
and ov.main_dep = "010"
group by ov.vstdate