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

前端 未结 4 933
一整个雨季
一整个雨季 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
    to_date('20120101','YYYYMMDD')
    

    should be fine...

    0 讨论(0)
  • 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' )
    
    0 讨论(0)
  • 2021-01-25 12:46

    You cans specify the format:

    to_date('20120101', 'yyyymmdd')
    
    0 讨论(0)
  • 2021-01-25 12:58
    SELECT to_date('20120101','YYYYMMDD') FROM dual;
    
    0 讨论(0)
提交回复
热议问题