Extract time part from TimeStamp column in ORACLE

前端 未结 7 1681
我寻月下人不归
我寻月下人不归 2021-01-02 01:14

Currently I\'m using MyTimeStampField-TRUNC(MyTimeStampField) to extract the time part from a timestamp column in Oracle.

SELECT CURRENT_TIMEST         


        
7条回答
  •  北海茫月
    2021-01-02 02:17

    You want just date then use

    to_char(cast(SYSDATE as date),'DD-MM-YYYY')
    

    and if you want just time then use

    to_char(cast(SYSDATE as date),'hh24:mi:ss')
    

    the parameters are making all the changed

    'DD-MM-YYYY'
    

    and

    'hh24:mi:ss'
    

提交回复
热议问题