oracle中按时间间隔取数据


SELECT to_char(dt,'yyyy-mm-dd hh24:mi') FROM
( select to_date('2014/7/2 15:06:05', 'yyyy-mm-dd hh24:mi:ss') +((level-1) * 2) /24/60 dt
 from dual
  connect by level <=(to_date('2014/7/10 11:50:15','yyyy-mm-dd hh24:mi:ss')-                               
 to_date('2014/7/2 15:06:05','yyyy-mm-dd hh24:mi:ss'))*24*60*60/120  )

猜你喜欢

转载自a--bian.iteye.com/blog/2115306