คำสั่งที่ประมวลผลช้าครับ มี2 คำสั่งขณะเปิดหน้าจอ ทันตกรรม
1. select ovst.*,substring(concat(ovstost.name,' [',spclty.name,']'),1,250) as ovstname,t.pdx as icdcode,icd101.name as icdname,patient.birthday,concat(patient.pname,' ',patient.fname,' ', patient.lname) as ptname,dtmain.dn , r.vn as rx_vn,t.rcpno_list ,dl.dt_list from ovst left outer join vn_stat t on t.vn=ovst.vn left outer join spclty on spclty.spclty=ovst.spclty left outer join patient on ovst.hn=patient.hn left outer join ovstost on ovst.ovstost=ovstost.ovstost left outer join icd101 on icd101.code=t.main_pdx left outer join dtmain on dtmain.vn = ovst.vn and dtmain.tm_no = 1 left outer join rx_operator r on r.vn=ovst.vn and r.pay='Y' left outer join dt_list dl on dl.vn=ovst.vn where ovst.vstdate='2007-04-09' and ovst.vn in ('500409073145','500409075536','500409075639','500409075849','500409080146','500409080356','500409080512','500409080530','500409080603','500409080737','500409080745','500409081455','500409081744','500409082116','500409082156','500409082208','500409082410','500409082548','500409082549','500409082731','500409082917','500409083007','500409083042','500409083101','500409083116','500409083405','500409084516','500409084542','500409084615','500409084647','500409084702','500409084717','500409084817','500409084932','500409085307','500409085329','500409085458','500409085632','500409085715','500409085752','500409085807','500409085821','500409090026','500409090159','500409090329','500409090337','500409090354','500409090835','500409091044','500409091128','500409091146','500409092121','500409092129','500409092136','500409092754','500409093032','500409093927','500409094031','500409094139','500409101040','500409101211','500409101640','500409125549','500409125616','500409125653','500409131708','500409145514') order by ovst.pt_priority desc,ovst.cur_dep_time,ovst.vsttime
2.
select ovst.*,substring(concat(ovstost.name,' [',spclty.name,']'),1,250) as ovstname,t.pdx as icdcode,icd101.name as icdname,patient.birthday,concat(patient.pname,' ',patient.fname,' ', patient.lname) as ptname,dtmain.dn , r.vn as rx_vn,t.rcpno_list ,dl.dt_list from ovst left outer join vn_stat t on t.vn=ovst.vn left outer join spclty on spclty.spclty=ovst.spclty left outer join patient on ovst.hn=patient.hn left outer join ovstost on ovst.ovstost=ovstost.ovstost left outer join icd101 on icd101.code=t.main_pdx left outer join dtmain on dtmain.vn = ovst.vn and dtmain.tm_no = 1 left outer join rx_operator r on r.vn=ovst.vn and r.pay='Y' left outer join dt_list dl on dl.vn=ovst.vn where ovst.vstdate='2007-04-09' and ovst.vn in ('500409075536','500409075639','500409075849','500409080146','500409080356','500409080512','500409080530','500409080603','500409080737','500409080745','500409081455','500409081744','500409082116','500409082156','500409082208','500409082917','500409083042','500409083101','500409083405','500409084542','500409084615','500409084702','500409084717','500409084817','500409084932','500409085329','500409085632','500409085715','500409085752','500409090159','500409090337','500409090354','500409090835','500409092121','500409092754','500409093032','500409094139','500409101040','500409101211','500409101640','500409125549','500409145514') order by ovst.pt_priority desc,ovst.cur_dep_time,ovst.vsttime