ลองเอาไปปรับแก้ดูครับ.....โดยใช้ Code ตามนี้ หรือลองปรับแก้file ที่แนบ
select concat(p.pname,p.fname," ",p.lname) as ptname,
d.name as request_doctor_name,
h.*,l.*,i.lab_items_unit,i.lab_items_normal_value ,i.lab_items_name ,o.name as reportername
from lab_head h
left outer join lab_order l on l.lab_order_number=h.lab_order_number
left outer join lab_items i on i.lab_items_code=l.lab_items_code
left outer join patient p on p.hn=h.hn
left outer join doctor d on d.code=h.doctor_code
left outer join opduser o on o.loginname=h.reporter_name
where h.lab_order_number = 822
order by i.display_order,i.lab_items_name