select sg.sgname as tsgname,
t.suid as tsuid,
sg.sgid as sgsgid,
t.systemtime as tsystemtime,
to_char(ceil((ceil(t.speed * 0.036) /to_number(substr(t.ostdesc,instr(t.ostdesc, '阈') + 3,3)) - 1) * 100)) as tt
from mcc_track t,
serviceunit sc,
servicegroup sg,
vehicle v,
mobile m
where t.utc >= 1175385600
and t.utc < 1177891200
and m.mtype = 12
and t.ostdesc like '%超速报警%'
and t.ostdesc like '%定位有效%'
and t.ostdesc like '%定时间隔%'
and t.suid = sc.suid
and sc.sgid = sg.sgid
and sc.vid = v.vid
and sc.sgid = v.sgid
and sc.mid = m.mid
and sg.psgid = 1525
and substr(t.ostdesc, instr(t.ostdesc, '阈') + 3, 3)<>'000'
and substr(t.ostdesc, instr(t.ostdesc, '阈') + 3, 3) <trim(to_char(t.speed * 0.036, '000'))
and ceil(t.speed * 0.036) < 150) a
group by a.tsgname, a.sgsgid
========================================================================
mcc_track 为二千万条数据的大表