在Oracle PL-SQL中,between and 函数的用法

例子:

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...的函数可能会慢些 。

 

 

 

你可能感兴趣的:(在Oracle PL-SQL中,between and 函数的用法)