group by 解决多参数及多参数方法操作后聚合表达
1)group by 只对单一参数分组:
from d in _dbContext.table
where type = 1
group d by new { d.CreateTime.Hour} into g
select new UseGasDistribute
{
HourTime = g.Key,
ActuallyUse = g.Sum(t => t.MonitorValue)
}
2)group by 对多个参数分组:
from d in _dbContext.table
原创
2020-07-16 17:23:45 ·
1083 阅读 ·
0 评论