日期:2014-05-16  浏览次数:20700 次

MySQL时间格式转换
MySQL里面字段ApplyTime日期格式为20120101如何转换为2012-01-01,如何在中间插入"-"字符

------解决方案--------------------
小写的m

mysql> select str_to_date('20120101','%Y%m%d');
+----------------------------------+
| str_to_date('20120101','%Y%m%d') |
+----------------------------------+
| 2012-01-01 |
+----------------------------------+
1 row in set (0.00 sec)