MySQL常用SQL

DATE_FORMAT

SELECT DATE_FORMAT(ctime,'%Y-%m-%d') AS DATE,COUNT(1) AS amount FROM t_table_x t WHERE t.`ctime` >='2016-09-01' GROUP BY DATE_FORMAT(ctime,'%Y-%m-%d');

相关推荐