查10月的数据
select DATEPART(HH,请求日期) as 几点,COUNT(*) as 请求人数
from tablename
where DATEPART(MM,请求日期)=10
group by DATEPART(HH,请求日期)
select DATEPART(HH,请求日期) as 几点,COUNT(*) as 请求人数
from tablename
where DATEPART(MM,请求日期)=10
group by DATEPART(HH,请求日期)
调试欢乐多
,count(distinct [号码]) as '请求人数'
From Table1
where convert(nvarchar(7),[请求日期],120)=convert(nvarchar(7),getdate(),120)
group by datepart(hh,[请求日期])
select datepart(d,请求日期) as 时间段,count(*) as 访问人数 from tb
group by datepart(d,请求日期)
from tb
where convert(varchar(7),请求时间,120)=convert(varchar(7),getdate(),120)
group by datepart(hour,请求时间)