字段是datatime格式
//当日新加的积分
select SUM(integral) from 表名 where 时间字段 >= date(now()) and 时间字段 < DATE_ADD(date(now()),INTERVAL 1 DAY)
//当月新加积分
select SUM(integral) from 表名 where DATE_FORMAT(时间字段,'%Y-%m')=DATE_FORMAT(CURDATE(),'%Y-%m')
字段是时间戳格式
//当日新增人数
select count(id) from 表名 Where date_format(from_unixtime(时间字段),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
//当月新增人数
select count(id) from 表名Where date_format(from_unixtime(时间字段),'%Y-%m') = date_format(now(),'%Y-%m')
仅供自己记录使用,大神勿喷