MYSQL 统计某时间段内每天的总数

统计一个月中,每天加入的会员总数

SELECT FROM_UNIXTIME(add_time, '%Y-%m-%e'), COUNT(*) AS count FROM member WHERE add_time BETWEEN UNIX_TIMESTAMP('2016-1-1 00:00:00') AND UNIX_TIMESTAMP('2016-1-31 00:00:00') GROUP BY FROM_UNIXTIME(add_time, '%Y%m%e') ORDER BY add_time;

你可能感兴趣的:(mysql)