FROM register
WHERE `creattime` LIKE '2012%'
GROUP BY lefttime
select * from 表名 where 时间字段名>=date_sub(curdate(),interval 7 day)近一周的数据
select DATE_FORMAT(d.dateType,'%Y%u') as '年份周数',d.shuzhi,d.type
from 'date_dealsheetpage'd
order by d.dateType
查询每周
select SUBSTRING(d.dateType, 1,7) as '年份月份',d.shuzhi,d.type
from 'date_dealsheetpage'd
查询每月
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)