如何在 LINQ 中选择属于 group by 的字段?
例如。:
var result = from a in table
where Date >= DataStart && Date <= DataStop
group a by a.Field2 into b
select new
{
AA = b.Sum(x => x.Total),
BB = a.Field2
};