select cm.hn as HN,concat(pt.pname,pt.fname,' ',pt.lname) as Name,
concat(pt.addrpart," ?.",pt.moopart," ?.",t3.name," ?.",t2.name," ?.",t1.name) as Address,
cm.lastvisit ,lh.order_date,lh.lab_order_number,o.fbs,c2.name,l3.lab_items_name,l2.lab_order_result
from clinicmember cm
left outer join lab_head lh on lh.hn=cm.hn
left outer join opdscreen o on o.vn=lh.vn
left outer join patient pt on pt.hn=cm.hn
left outer join lab_order l2 on l2.lab_order_number=lh.lab_order_number
left outer join lab_items l3 on l3.lab_items_code=l2.lab_items_code
left outer join thaiaddress t1 on t1.chwpart=pt.chwpart and t1.amppart="00" and t1.tmbpart="00"
left outer join thaiaddress t2 on t2.chwpart=pt.chwpart and t2.amppart=pt.amppart and t2.tmbpart="00"
left outer join thaiaddress t3 on t3.chwpart=pt.chwpart and t3.amppart=pt.amppart and t3.tmbpart=pt.tmbpart
left outer join clinic c2 on c2.clinic=cm.clinic
where cm.clinic = '001' and l2.lab_items_code = "316" and l2.confirm = "Y" and lh.order_date between '2009-10-01' and '2010-09-30'
order by lh.order_date,cm.hn
ลองดูเป็นตัวอย่างครับ สีแดง lab hba1c