TO_DATE function in ORACLE

前端 未结 4 1000
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 06:07

I was trying the TO_DATE function. Specifically, I noted that the following queries

1. SELECT TO_CHAR(TO_DATE(\'01-01-2015\',\'DD-MM-YYYY\'),\'DD-MO         


        
4条回答
  •  走了就别回头了
    2021-01-28 06:44

    The default output format of DATE value, resp TO_DATE() function is set by NLS_DATE_FORMAT value. You can verify it with this query:

    SELECT * 
    FROM V$NLS_PARAMETERS 
    WHERE PARAMETER = NLS_DATE_FORMAT';
    

    You can change it on session level for example with

    alter session set NLS_DATE_FORMAT = 'DD-MM-YYYY';
    

提交回复
热议问题