根据入库时间按照30分钟统计数据

select  count(*) , ( case float (to_char(createdate,'MI') / 30)  when 0 then to_char(createdate,'yyyy-mm-dd HH24' || 00)  when 1 then to_char(createdate,'yyyy-mm-dd HH24' || 30)  end )  from task group by  

 ( case float (to_char(createdate,'MI') / 30)  when 0 then to_char(createdate,'yyyy-mm-dd HH24' || 00)  when 1 then to_char(createdate,'yyyy-mm-dd HH24' || 30)  end ) 

猜你喜欢

转载自yehandjava.iteye.com/blog/2115067