有一个表account,里面有一个time字段,我要根据某一个时间段来查询这个时间段中每一天有多少人注册。请问这个要怎么做?
比如:2007-10-1至2007-10-31,我要知道10-1这一天有多少人,10-2有多少人。
请问这个要怎么写,是sqlserver2000.谢谢了~~~~~~~

解决方案 »

  1.   


    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 '时间'
      

  2.   

    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 '时间'