日期:2014-05-16 浏览次数:20626 次
mysql> select date_format(concat(2010,10,10),'%Y-%m-%d'); +--------------------------------------------+ | date_format(concat(2010,10,10),'%Y-%m-%d') | +--------------------------------------------+ | 2010-10-10 | +--------------------------------------------+ 1 row in set (0.00 sec) mysql>
------解决方案--------------------
mysql> select date('2010-10-12'); +--------------------+ | date('2010-10-12') | +--------------------+ | 2010-10-12 | +--------------------+ 1 row in set (0.04 sec) mysql>
------解决方案--------------------
select DATE(concat(2010,10,10))
------解决方案--------------------
如果是数值类型的,直接用DATE函数啊
mysql> SELECT DATE(20101012); +----------------+ | DATE(20101012) | +----------------+ | 2010-10-12 | +----------------+ 1 row in set (0.00 sec)