select *
from (select count(distinct a.MSG_ID) as MSG_COUNT,
SUBSTR(a.MSG_CD, 4, 8) as MSG_CD5,
SUBSTR(a.MBL_NO, 1, 7) as MBL_NO7
from pubtlogjnl a
where (a.BEG_TM + a.PROC_TM) > 1292379923602
and (a.BEG_TM + a.PROC_TM) < 1292380523618
group by SUBSTR(a.MSG_CD, 4, 8), SUBSTR(a.MBL_NO, 1, 7)) t,
cmmtmbst b
where t.MBL_NO7 = SUBSTR(b.mbl_sgm, 1, 7)
需要建个索引
create index T_idx on pubtlogjnl(BEG_TM+PROC_TM);
执行速度由原来的>200秒,减少至<1S
阅读(488) | 评论(0) | 转发(0) |