根据时间段,查询时间段内每一天的人数

梅子 2007-10-25 11:51:13
有一个表account,里面有一个time字段,我要根据某一个时间段来查询这个时间段中每一天有多少人注册。请问这个要怎么做?
比如:2007-10-1至2007-10-31,我要知道10-1这一天有多少人,10-2有多少人。。。。
请问这个要怎么写,是sqlserver2000.谢谢了~~~~~~~
...全文
177 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
fengming2222 2007-10-25
  • 打赏
  • 举报
回复
select convert(char(10),time,120) as '时间',count(*) as '注册人数'
from account
where time between '2007-10-1' and '2007-10-31'
group by convert(char(10),time,120) as '时间'
order by convert(char(10),time,120) as '时间'

gahade 2007-10-25
  • 打赏
  • 举报
回复

select convert(char(10),time,120) as '时间',count(*) as '注册人数'
from account
group by convert(char(10),time,120) as '时间'
order by convert(char(10),time,120) as '时间'


梅子 2007-10-25
  • 打赏
  • 举报
回复
急~~~~~~~~~~求高手指点~~~~~~~~~~~~~
梅子 2007-10-25
  • 打赏
  • 举报
回复
非常感谢了~~~

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧