我有一个名为templog的表,我有一个名为'tdate'的日期列,它以'mm / dd / yy'格式存储一个字符串。我尝试使用以下语法进行转换,但收到错误。
SELECT convert(datetime,tdate,110) from templog
SQL查询:文档
SELECT转换(datetime,tdate,110)来自templog LIMIT 0,25 MySQL说:文档
关于我做错了什么的任何想法?
对于MariaDB,你想要str_to_date()
:
SELECT str_to_date(tdate, '%m/%d/%y')
FROM templog