select h.lab_order_number,v.pcode,a.pcode as apcode, h.lab_receive_number,h.vn,h.hn,h.order_date ,h.order_time,
h.lock_result,h.receive_time as service13,h.report_time as service14 ,h.confirm_report,d.name as doctor_name,
h.form_name,v.age_y as vage_y,a.age_y as aage_y ,h.department ,concat(pt.pname,pt.fname," ",pt.lname) as fullname,
a.an, w.name
from lab_head h
left outer join patient pt on pt.hn=h.hn
left outer join doctor d on d.code=h.doctor_code
left outer join vn_stat v on v.vn=h.vn
left outer join an_stat a on a.an=h.vn
left outer join ward w on w.ward=a.ward
where h.vn like '500000041'
order by lab_order_number='1704'
โค๊ดและพารามิเตอร์ เป็นของเดิมที่ เซ็ตไว้น่ะครับ อ. คือ vn ,lab_order_number