MySQL按日期分组并从unix时间戳转换 [英] MySQL group by date and convert from unix timestamp

查看:232
本文介绍了MySQL按日期分组并从unix时间戳转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下sql表(简体)

I have the following sql table (simplified)

ID (int)  title (text)            date (int)
--------------------------------------------
1         Hello World             1378148920
2         Hello World2            1378182183
3         Hello World3            1378129838
4         Hello World4            1378146160
5         Hello World5            1378138038
....

该表具有数千个条目.

The table has thousands of entries.

我不会问你是否有可能构建一个SQL查询,该查询将所有帖子按日期分组,而仅按天分组.

I wan't to ask you if it is possible to build a SQL query that groups all the posts by date but only as day.

因此,最后我将无法建立这样的图形(过去5天):

So at the end I wan't to build a graph like this (for the last 5 days):

02.09.2013: 13 posts
01.09.2013: 14 posts

注意:时间戳记不是真实的(它们都是从今天开始的)

NOTE: the timestamp aren't real (they are all from today)

推荐答案

您可以使用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆