办法比较笨,但可行:
select to_date(to_char(sysdate)) from dual
where (to_date(to_char(sysdate))-to_date(to_char(sysdate)))=0
select to_date(to_char(sysdate)) from dual
where (to_date(to_char(sysdate))-to_date(to_char(sysdate)))=0
4?
6?
8?
.....
select * from tb
where to_char(operate_date,'yyyymmdd') between :date1 and :date2 ;
参数类型为字符串,格式类似于'20040912'
where operate_date
between to_date(:date1,'yyyymmdd') and to_date(:date2,'yyyymmdd'); 参数类型为字符串,格式类似于'20040912'
from table_anme
where operate_date >=to_date(:date1,'dd-mm-yyyy') and operate_date <=to_date(:date2,'dd-mm-yyyy')