oracle 时间相关

前端之家收集整理的这篇文章主要介绍了oracle 时间相关前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

判断当天:@H_403_3@

select * from table_name@H_403_3@

where v_date>=trunc(sysdate)@H_403_3@


@H_403_3@

获取今天小时列表,两种方法都可以@H_403_3@

select level,to_char(trunc(sysdate)+level/24-1,'HH24') as dat
from dual
connect by level <= ROUND(TO_NUMBER(sysdate - trunc(sysdate)) * 24)
@H_403_3@


@H_403_3@

select to_char(sysdate +(rownum - 1) / 24,'hh24') AS shijian from DUAL connect by rownum <= 24 ORDER BY shijian @H_403_3@

猜你在找的Oracle相关文章