62,041
社区成员
发帖
与我相关
我的任务
分享
select day(采集时间) as 号数, sum(值) as 合计 from aaa where year(采集时间)=2018 and month(采集时间)=1 group by day(采集时间)
select * from [dbo].[Users]
select DAY(regTime) '号数',SUM(id) '值' from Users
group by DAY(regTime)
with t as (select v = 值, d = datepart(dd, 采集时间) from aaa where datepart(yyyy, 采集时间) = @year and datepart(mm, 采集时间))
select d, sum(v) from t group by d