1
因此,這裏是原始查詢SQL到L2S翻譯幫助
SELECT SUM(PickQty),SUM(ReqQty),AssignmentID,StopID FROM PickRequest GROUP BY AssignmentID,在LINQ
StopIDfrom a in dbReqs
group a by new { a.AssignmentID, a.StopID }
into pr
select new
{
Assignment = pr.Key,
StopID = pr.Select(s=> s.StopID),
PickQty = pr.Sum(p=> p.PickedQty),
Count = pr.Sum(c => c.ReqQty)
}
我一定在做錯事,因爲LINQ版本需要很長時間,而且結果似乎有點偏離。想法?