查询两个年份、月份或日期之间的数据
--查询年份
select * from document_main t where to_char(t.receivedate,'yyyy')>='2010' and to_char(t.receivedate,'yyyy')<='2012'
--查询月份
select * from document_main t where to_char(t.receivedate,'yyyy-mm')>='2010-01' and to_char(t.receivedate,'yyyy-mm')<='2012-01'
--查询日期
select * from document_main t where to_char(t.receivedate,'yyyy-mm-dd')>='2010-01-01' and to_char(t.receivedate,'yyyy-mm-dd')<='2012-01-01'