ORACLE時間段查詢優化的問題?
試試下面語句:SELECT SID, SSJSID, RQ, SJ FROM JING_SS Where to_char(rq,'yyyyMMdd') between 開始日期 and 結束日期 and not to_char(sj,’hh24mmss')結束時間and to_char(rq,'yyyyMMdd')=結束日期 and ssjsid in (select sid fromcom_dw connect by prior sid=fid start with sid=單位編號) Order by sid;