在mysql中处理时间戳
时间:2010-09-17 来源:luoine
把mysql中时间戳转化成正常时间, 用mysql函数: from_unixtime(数据库time字段,“%Y%m%d”);
例如,按月统计:
- select count(id), from_unixtime(select_time,'%Y-%m') as result, from_unixtime(select_time,'%Y')as year, from_unixtime(select_time,'%m') as month
- from diray
- group by year, month
- order by year desc, month desc
相关阅读 更多 +