显示每日帖子数量
现有表topics,含有字段id,addtime,title,content等,我现在想以列表的形式显示每日发表的帖子总数,像这样:
2013/1/3 帖子总数:200
2013/1/2 帖子总数:210
2013/1/5 帖子总数:180
这应该算是sql的问题吧,求解,谢谢
------解决方案--------------------SQL:
select addtime, count(addtime) as n from topics group by addtime
------解决方案--------------------select CONVERT(varchar(10),addtime,23),count(addtime) as sl from topics group by CONVERT(varchar(10),addtime,23)