在mysql中处理时间戳

把mysql中时间戳转化成正常时间, 用mysql函数: from_unixtime(数据库time字段,“%Y%m%d”);

例如,按月统计:

1select count(id), from_unixtime(select_time,'%Y-%m'as result, from_unixtime(select_time,'%Y')as year, from_unixtime(select_time,'%m'as month
2                from diray
3                group by  yearmonth 
4                order by  year descmonth desc
posted @ 2008-12-27 10:20  狼问苍穹  阅读(464)  评论(0编辑  收藏  举报