怎样让日期范围走索引?

怎样让日期范围走索引?
最新回答
浅笑等壹个晴天

2020-07-12 23:12:12

Oracle中我们经常使用Date字段类型记录日期和时间,有的时候还在这个字段上建立索引。\x0d\x0a然后通过Java程序访问数据库的时候,我们很自然的类似这样使用:select * from table where endDate>? and endDate? and TO_TIMESTAMP(endDate)to_date(?,’yyyymmddhh24miss’) and endDate