alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
select sysdate from dual;

解决方案 »

  1.   

    select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
      

  2.   

    select sysdate form dual;
      

  3.   

    select to_char(sysdate,'yyyy-mm-dd hh:mi:ssss') from dual;
      

  4.   

    select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
      

  5.   

    select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
      

  6.   

    方法1;
    alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
    select sysdate from dual;
    这种方法,在服务器端,比较有效,而且省掉了许多步骤,不过,如果要考虑到客户端的情况,最好使用下面的方法2方法2:
    select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;
    当然了,如果只是要插入系统时间到数据库中去的话,这样定义数据类型就可以了
    test_date date default sysdate--------------------------------------
    希望多交流!