mysql中实现统计每日

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/a114469/article/details/80704590


记录一下,实操过。。。

时间戳格式

FROM_UNIXTIME(create_time,'%Y-%m-%d') as time

日期格式

DATE_FORMAT(create_time,'%Y-%m-%d') as time

查询每一条插入的条数,每天:

SELECT FROM_UNIXTIME(create_time,'%Y-%m-%d') as time , count(*) as count FROM 表名 where 条件 GROUP BY  time

结果:

猜你喜欢

转载自blog.csdn.net/a114469/article/details/80704590