between and 函数

来源:互联网 发布:python虚拟主机 编辑:程序博客网 时间:2024/05/20 20:43

例子:

select * from table_test where creatdate between to_date('2009-11-1 8:47:14','yyyy-mm-dd hh24:mi:ss') and to_date('2009-12-1 8:47:14','yyyy-mm-dd hh24:mi:ss') 


推荐使用:

select * from table_test where creatdate >= to_date('2009-11-01 8:47:14','yyyy-MM-DD') and creatdate <= to_date('2002-03-01' ,'YYYY-MM-DD');


用between...and...的函数可能会慢些 。

 

 

 

20 0
原创粉丝点击