- 论坛徽章:
- 0
|
补全了函数,假定间隔interv单位为分钟:
select to_date('&t0','yyyy/mm/dd hh:mi:ss') + (a - 1)/1440*&interv ,
to_date('&t0','yyyy/mm/dd hh:mi:ss') + a/1440*&interv, count(*)
from (
select
decode(ceil((time - to_date('&t0','yyyy/mm/dd hh:mi:ss'))*1440/&interv), 0,1,
ceil((time - to_date('&t0','yyyy/mm/dd hh:mi:ss'))*1440/&interv)) a
from incoming_call
where time between to_date('&t0','yyyy/mm/dd hh:mi:ss')
and to_date('&t1','yyyy/mm/dd hh:mi:ss')
)
group by to_date('&t0','yyyy/mm/dd hh:mi:ss') + (a - 1)/1440*&interv ,
to_date('&t0','yyyy/mm/dd hh:mi:ss') + a/1440*&interv; |
|