标签:bsp image dual sel span select nec 分享 color
1、获取当前时间的前24小时的各小时时间段
select to_char(to_date(to_char(sysdate - (rownum - 1) / 24,‘yyyy-mm-dd hh24‘) || ‘:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘),‘yyyy-mm-dd hh24:mi:ss‘) totaldate from dual connect by rownum <= 24 order by totaldate desc
2、获取某天的0点到24点的各小时时间段
select TO_CHAR(to_date(‘2019-01-28‘,‘yyyy-mm-dd‘) + (rownum - 1) / 24,‘yyyy-mm-dd hh24:mi:ss‘) TIMES from DUAL connect by level <= 24
标签:bsp image dual sel span select nec 分享 color
原文地址:https://www.cnblogs.com/dqcer/p/10331231.html