日期:2014-05-17 浏览次数:20897 次
BETWEEN to_date([color=#FF0000]'2012-8-28 00:00:00'[/color],'yyyy-mm-dd hh24:mi:ss') and to_date('2012-8-28 23:59:59','yyyy-mm-dd hh24:mi:ss')
------解决方案--------------------
select * from dual where trunc(to_date(dt,'yyyy-mm-dd hh24:mi:ss'),'dd')
BETWEEN to_date('2012-8-28','yyyy-mm-dd') and to_date('2012-8-29','yyyy-mm-dd');
------解决方案--------------------
2012-8-28 = 2012-8-28 00:00:00
所以只要改成
dt BETWEEN to_date('2012-8-28 00:00:00','yyyy-mm-dd hh24:mi:ss') and to_date('2012-8-28 23:59:59','yyyy-mm-dd hh24:mi:ss')
即可