当前位置: 代码迷 >> Oracle管理 >> 用to_char形式查找日期为指定年月的数据,用时2秒多,有没有快点的方法
  详细解决方案

用to_char形式查找日期为指定年月的数据,用时2秒多,有没有快点的方法

热度:34   发布时间:2016-04-24 04:22:08.0
用to_char方式查找日期为指定年月的数据,用时2秒多,有没有快点的方法
用to_char方式查找日期为指定年月的数据,
to_char(rq,'yyyymm')='201403' ,返回的记录数量大概3万多条,
用时2秒多,
有没有快点的方法?

------解决方案--------------------
不使用函数,直接进行日期对比呢
如:
rq between to_date('20140301','yyyymmdd') and to_date('20140331','yyyymmdd')