您可以用来
count对每个行进行计数
[GroupId]并
sum计算每个属性。
select [GroupId] , count([GroupId]) as [TotalRows] , sum([IsGreen]) as [TotalGreen] , sum([IsRound]) as [TotalRound] , sum([IsLoud]) as [TotalLoud]from [TestData]group by [GroupId]
欢迎分享,转载请注明来源:内存溢出
您可以用来
count对每个行进行计数
[GroupId]并
sum计算每个属性。
select [GroupId] , count([GroupId]) as [TotalRows] , sum([IsGreen]) as [TotalGreen] , sum([IsRound]) as [TotalRound] , sum([IsLoud]) as [TotalLoud]from [TestData]group by [GroupId]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)