--例如查询09:00:00~09:59:59之间的数据
SELECT
TO_CHAR(CRTE_DATE,'yyyy-mm-dd hh24:mi:ss'),
UPGRADE.*
FROM
UPGRADE
WHERE
CRTE_DATE >= TRUNC(sysdate ,'HH24')-1/24
AND CRTE_DATE < TRUNC(sysdate ,'HH24')
ORDER BY
ID;
测试:11:05查询10:00:00~10:59:59的数据
数据库数据:
测试结果:
测试正常!