查询分割时间,group by天数

select a.groupid,count(a.id) as number from
(select id, FROM_UNIXTIME(time, '%Y-%m-%d') as groupid from student where time>=0) as a
group by a.groupid
order by a.groupid

你可能感兴趣的:(查询分割时间,group by天数)