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

请问group by a,b linq to sql 怎么写呀?
请问group by a,b linq to sql 怎么写呀?

------解决方案--------------------
LINQ to SQL语句之Group By/Having
------解决方案--------------------
List <A> List = new List <A>(); 
var P= List 
.GroupBy(x => new { x.Age, x.Sex }) 
.Select(group => new { 
Stu= group.Key, Count = group.Count() 
}); 
foreach (var a in P) { 
  

LS连接很全面
------解决方案--------------------
http://kb.cnblogs.com/zt/linq/
------解决方案--------------------
探讨
List <A> List = new List <A>();
var P= List
        .GroupBy(x => new { x.Age, x.Sex })
        .Select(group => new {
            Stu= group.Key, Count = group.Count()
        });
foreach (var a in P) {
 
}
LS连接很全面