Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个varchar专栏,我想将其转换yyyy-mm-dd hh:mi:ss为mm-dd-yyyy hh:mi:ss日期并将其转换为日期。怎么做到呢?
varchar
yyyy-mm-dd hh:mi:ss
mm-dd-yyyy hh:mi:ss
要将字符串转换为日期:
to_date (the_string, 'yyyy-mm-dd hh:mi:ss')
如果您希望将其格式化为格式为 mm-dd-yyyy hh:mi:ss 的字符串:
to_char (to_date (the_string, 'yyyy-mm-dd hh:mi:ss'), 'mm-dd-yyyy hh:mi:ss')