为什么我在执行下面语句时
select to_timestamp('2000-1-1 0:0:0.123456789', 'syyyy-mm-dd hh24:mi:ss.ff9') from dual;
会提示ora-01821: date format not recognized而执行select to_timestamp('2000-1-1 0:0:0.123456789', 'syyyy-mm-dd hh24:mi:ss.ff') from dual;就正常???

解决方案 »

  1.   


    select to_timestamp('2000-01-10 00:00:0.123456789', 'yyyy-mm-dd hh24:mi:ss.ff9') time from dual; 
    --结果:
        TIME
    1 10-1月 -00 12.00.00.123456789 上午
      

  2.   

    再用to_char转,然后字符串截取想要的位数,不知道有没其他好方法
      

  3.   

    你这个报错是因为yyyy前面多了一个s
      

  4.   

    select to_timestamp('2000-1-1 0:0:0.123456789', 'syyyy-mm-dd hh24:mi:ss.ff9') from dual;这句我执行没有问题,返回:
    TO_TIMESTAMP('2000-1-10:0:0.12
    --------------------------------------------------------------------------------
    01-1月 -00 12.00.00.123456789 上午字符集是:SQL> select name,value from v$parameter where name = 'nls_language';
     
    NAME                                                                             VALUE
    -------------------------------------------------------------------------------- nls_language                                                                     SIMPLIFIED CHINESE
     
      

  5.   

    我的字符集是:
    SQL> select name,value from v$parameter where name = 'nls_language'; NAME                                                                            VALUE 
    -------------------------------------------------------------------------------- nls_language                                                                    SIMPLIFIED AMERICAN
    和这个有关系吗?