select c.hn,pt.pname,pt.fname,pt.lname,max(s.vstdate) lastdate
,substring_index(group_concat(cast(bps as decimal) order by vn desc),',',3) bps
,substring_index(group_concat(cast(bpd as decimal) order by vn desc),',',3) bpd
from opdscreen s
left join clinicmember c on s.hn=c.hn
left join patient pt on c.hn=pt.hn
where c.clinic=002
and s.vstdate between '2012-10-1' and '2013-9-30'
and s.bps>0
group by c.hn