日期格式转换:
SQL> select to_char(to_date('01sep','ddmon','nls_date_language=American'),'mm-dd') from dual;
TO_CHAR(TO_DATE('01SEP','DDMON
------------------------------
09-01
比较大小
action层String endDate
mapper层(db中t_o_d.tk_ftda=01sep,varchar2)
and TO_CHAR(TO_DATE(t_o_d.tk_ftda,'ddmon','nls_date_language=American'),'mm-dd') <= #{endDate,jdbcType=VARCHAR}
附:
Oracle 用to_char()日期区间比较
查询两个年份、月份或日期之间的数据
--查询年份
select * from document_main t where to_char(t.receivedate,'yyyy')>='2010' and to_char(t.receivedate,'yyyy')='2010-01' and to_char(t.receivedate,'yyyy-mm')='2010-01-01' and to_char(t.receivedate,'yyyy-mm-dd')=,