日期:2014-05-20 浏览次数:20991 次
var query=db.MemberLog.GroupBy(m=>m.MemberId).OrderByDescending(g=>g.Count()).Select(g=>g.First()).Take(3);
var result =( from a in Table
group a by a.memberid into g
orderby g.Count() descending
select new
{
MemberId =g.Key,
Count=g.Count()
}).Take(3);