oracle SQL how to remove time from date

前端 未结 5 693
小鲜肉
小鲜肉 2020-12-03 02:48

I have a column named StartDate containing a date in this format: 03-03-2012 15:22

What I need is to convert it to date. It should be looki

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 03:18

    We can use TRUNC function in Oracle DB. Here is an example.

    SELECT TRUNC(TO_DATE('01 Jan 2018 08:00:00','DD-MON-YYYY HH24:MI:SS')) FROM DUAL
    

    Output: 1/1/2018

提交回复
热议问题