sql按日期分组,没有时间 [英] sql group by date without time

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

问题描述

我是sql的新手,我想创建一个查询,该查询将计算每天的所有文章ID.但日期列中也包含时间的问题..因此,如何使查询按日期进行分组而又没有时间?

I am new to sql, and I would like to create a query that will count all my article id's for each day. but the problem the date column is also containing time.. so how I can make the query to group by just by date without time?

例如:

id|article_id|date (timestamp)

1|22|2014-01-10 13:30:10 
1|23|2014-02-10 12:30:10 

谢谢

推荐答案

尝试一下:

select count(article_id) from YourTable group by date(date)

这篇关于sql按日期分组,没有时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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