group by
var list = from s in _sysBll.GetList(s => s.ParamID == "TraSchType" && s.ParamCode != null) join t in data on s.ParamCode equals t.TraSchType group s by s.ParamCode into temp //如果是多个字段分组{s.paramcode,s.paramId} select new { ParamCode = temp.Key,//key代表分组字段,如果有多个分组字段,则由key.字段名 name = temp.Max(t=>t.ParamDescn), value=temp.Count() };