Need help converting date in format 20120130 to Date data type oracle sql

前端 未结 4 936
一整个雨季
一整个雨季 2021-01-25 12:29

Could you please help me in converting date from the format \"20120101\" to DATE format in Orcle Sql.

I looked at this link but it does not mention if the date format is

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-25 12:45

    If you have a string '20120101' that you want to convert into a date, assuming that the string contains a 4 digit year followed by a 2 digit month and a 2 digit day

    to_date( '20120101', 'YYYYMMDD' )
    

提交回复
热议问题