在做一個功能的時候,需要在oracle數據庫中查詢指定某一天的數據。
如果是簡單的當前日期前后幾天,也好辦
AND TO_CHAR(Rct.Creation_Date, 'YYYY-MM-DD')=to_char(sysdate-1,'yyyy-MM-dd')
即可
但是指定日期就不好弄了
可以這樣做
select * from test1 t where t.end_date
between to_date('2014-10-24 00:00:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2014-10-24 23:59:59','yyyy-mm-dd hh24:mi:ss');