EF left join 条目数量统计

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Humourer/article/details/81099794
  var list = from k in context.KnowledgeqaUserDB
                       join m in context.MemberDB
                       on k.MemberId equals m.ID
                       into temp
                       from t in temp.DefaultIfEmpty()
                       group new { k.MemberId,k.StartIntegral } by new { k.MemberId, k.StartIntegral, t.CellPhone } into z
                       select new
                       {
                           z.Key.MemberId,
                           StartIntegral = z.Sum(y => z.Key.StartIntegral),
                           z.Key.CellPhone
                       };

 

展开阅读全文

没有更多推荐了,返回首页