var data = Db.SqlQueryable<GPS_WY_DataTrend>(sqlstr);
//根据STCD分组 然后汇总每组的HorizontalWY值
var groupdata=data.GroupBy(t => t.STCD).Select(t=>new { STCD=t.STCD, HorizontalWY =SqlFunc.AggregateSum(t.HorizontalWY)}).OrderBy(t=>t.HorizontalWY,OrderByType.Desc).ToList();
Linq语句分组.GroupBy汇总Sum
最新推荐文章于 2024-07-01 22:56:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)