yejianwind(啸风) 的SQL有点小错误: between的范围是:>= and < 楼主的开始日期是>'2006-2-10',所以正解是: select * from test where to_date(Mytime,'yyyy-mm-dd') between to_date('2006-2-11','yyyy-mm-dd') and to_date('2006-2-13','yyyy-mm-dd') 或者更明白一点的: select * from test where to_date(Mytime,'yyyy-mm-dd') > to_date('2006-2-10','yyyy-mm-dd') and to_date(Mytime,'yyyy-mm-dd') < to_date('2006-2-13','yyyy-mm-dd')
between的范围是:>= and <
楼主的开始日期是>'2006-2-10',所以正解是:
select * from test where to_date(Mytime,'yyyy-mm-dd') between to_date('2006-2-11','yyyy-mm-dd') and to_date('2006-2-13','yyyy-mm-dd')
或者更明白一点的:
select * from test where to_date(Mytime,'yyyy-mm-dd') > to_date('2006-2-10','yyyy-mm-dd') and to_date(Mytime,'yyyy-mm-dd') < to_date('2006-2-13','yyyy-mm-dd')