วันนัดไม่ขึ้นเพราะว่า
vn ใน oapp ไม่มีอยู่ในตาราง doctot_order_print
------------------------------------------------------------
select d1.*,v1.*,o1.*,s.*,t.blobtext,t.blobtext2,pe.image1,ic.name as diag_name0,op.nextdate
from doctor_order_print d1
left outer join vn_stat v1 on v1.vn=d1.vn
left outer join ovst o1 on o1.vn=d1.vn
left outer join oapp op on op.vn=d1.vn
left outer join opdscreen s on s.vn = d1.vn
left outer join pe_image pe on pe.vn=d1.vn
left outer join tempreport t on t.name=d1.vn and t.reportname="DOCTOR-FORM"
left outer join icd101 ic on ic.code = v1.dx0
where d1.vn="510502164412" and d1.print_server="OPD1"
order by d1.order_no,d1.item_no