select distinct(d.dt), sum(d.num) from
(
select dt, count(*) as num,i.row_id,i.created_date from testtable i,
(select to_date('2011/12/4 18:54:30','yyyy/mm/dd HH24:mi:ss') + (level-1)/86400*5 dt from dual connect by level <= 2000) d
where i.created_date>=dt and i.created_date < d.dt+(5/86400)
group by d.dt,i.row_id,i.created_date
order by dt
) d group by d.dt
一个ORACLE间隔时间的查询语句
最新推荐文章于 2023-09-20 09:13:00 发布