oracle查询一段时间内的数据

时间:2021-06-10 10:01:29
oracle查询一段时间内的数据:左右两边要是char类型的话就都是char类型,要都是date类型就都是date类型
SELECT * FROM AIR_CITYHOURAQI_PUBLISH
WHERE TO_DATE ( TIMEPOINT , 'YYYY-MM-DD HH24:MI:SS' )
>= TO_DATE ( '2017-5-23 12:00:00' , 'YYYY-MM-DD HH24:MI:SS' )
AND TO_DATE ( TIMEPOINT , 'YYYY-MM-DD HH24:MI:SS' )
<= TO_DATE ( '2017-5-23 19:00:00' , 'YYYY-MM-DD HH24:MI:SS' )
SELECT * FROM AIR_CITYHOURAQI_PUBLISH
WHERE TIMEPOINT >= '2017-5-23 12:00:00'
AND TIMEPOINT <= '2017-5-23 19:00:00'