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.
我有一个 mysql 数据库,它有一个日期列,但它是 varchar 并且格式像这样 '01/05/2012' 但我需要将它转换为日期时间格式,因为我会做一些日期时间比较。
我能做些什么?
谢谢
使用STR_TO_DATE():
STR_TO_DATE()
SELECT STR_TO_DATE(`date`, '%d/%m/%Y') FROM tbl;