oracle中日期格式'yyyy-mm-dd'和'yyyymmdd'的区别
对于年月日中"日"是个位的情况下,处理不一样,'yyyymmdd'格式没问题,而式'yyyy-mm-dd'格式则不行,请看:
SQL> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
Session altered.
SQL> select to_date('2007059','yyyy-mm-dd hh24:mi:ss') from dual;select to_date('2007059','yyyy-mm-dd hh24:mi:ss') from dual *ERROR at line 1:ORA-01861: literal does not match format string
SQL> select to_date('2007059','yyyy-mm-dd') from d......
阅读全文