首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

一个ORACLE间隔时间的查询话语

2012-07-28 
一个ORACLE间隔时间的查询语句select distinct(d.dt), sum(d.num) from (select dt, count(*) as num,i.ro

一个ORACLE间隔时间的查询语句

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

热点排行