日期:2014-05-20  浏览次数:20843 次

请教如何将SQL转换成LINQ语句,语句如下
select document,max(P1) as P1,max(P2) as P2 from table group by document

------解决方案--------------------
var source=from t in table group t by t.document into g select new{key=g.key,P1=g.Max(s=>s.P1),P2=g.Max(ss=>ss.P2)};