Select AB.aid,SUM(C.Qty)
from C
join a-b AB on C.bid= AB.bid
group by AB.aid

解决方案 »

  1.   

    查a-b和C就可以了啊?
    var result = from p in listAB
                             from q in listC
                             where p.bid == q.bid
                             select new
                             {
                                 p.aid,
                                 q.Qty,
                             } into g
                             group g by g.aid into s
                             select new
                             {
                                 Key = s.Key,
                                 Value = s.Sum(x => x.Qty)
                             };
      

  2.   

    to: guwei4037listAB,我应该怎么组合,因为没有映射这个表实体
      

  3.   

    public class listAB
    {
    public string aid{get;set;}

    }