时间要有单引号的,不然实际执行的是算术运算
select * From Book where EditionDate>(2001-1-1) 等同于
select * From Book where EditionDate>1999
1999可以隐式转换为日期,所以有结果。
正确写法是
select * From Book where EditionDate>'2001-1-1' and EditionDate<'2008-12-31'
可以先转换成时间类型再比较撒
EditionDate>to_date('2001-1-1','yyyy-MM-dd') and EditionDate
AND EditionDate > timestamp '2001-1-1'
AND EditionDate < = timestamp '2008-12-31'
select * From Book where EditionDate>'2001-1-1' and EditionDate<'2008-12-31'
select * From Book where EditionDate>(2001-1-1) or EditionDate<(2008-12-31)