ใช้คำสั่งนี้ครับ
select d1.*,v1.*,o1.*,op.*,p.drugallergy,concat("[",v1.pdx,"]",i1.name) as icd_name,concat("
",doc.name) as commadname,i1.name as pdx_name
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 patient p on p.hn = v1.hn
left outer join opdscreen op on op.vn = d1.vn
left outer join icd101 i1 on i1.code=v1.main_pdx
left outer join doctor doc on doc.code=o1.command_doctor
where d1.vn="511215115219" and d1.print_server="DOCTOR-1"