sql 查询每天数据

一 表 内数据存的是 ‘2017-09-08 15:13:59’这样格式   

 

表 

customer_mate_follow

时间字段
created_at 
 

1,

SELECT
SUBSTRING(created_at,1,10) as day,
COUNT(created_at) as num

FROM
    `customer_mate_follow`
GROUP BY
SUBSTRING(created_at,1,10) ORDER BY created_at asc;

一 表 内  插入数据存的是时间戳  

$now=strtotime(date('Y-m-d'));


SELECT * FROM `customer_mate_follow` where 'created_at' > $now;
原文地址:https://www.cnblogs.com/wen-zi/p/9076607.html