码迷,mamicode.com
首页 > Windows程序 > 详细

C#中对DataTable进行全连接后group by,orderby

时间:2017-06-07 18:44:05      阅读:1073      评论:0      收藏:0      [点我收藏+]

标签:data   end   res   ase   连接   datatable   csu   job   cpu   

var result = from temp2 in
                             (
                                 from u in users.Tables[0].AsEnumerable()
                                 join s in hpcSummary.Tables[0].AsEnumerable() on u.Field<String>("DomainUser") equals s.Field<String>("CountObj")
                                 select new
                                 {
                                     SolverName = s.Field<String>("Solver"),
                                     CountObj = s.Field<String>("CountObj"),
                                     NumJob = s.Field<Int64>("Jobs"),
                                     CpuTime = s.Field<Double>("TotalCPUTime")
                                 }
                            )
                         orderby temp2.NumJob descending
                         group temp2 by new { SolverName = temp2.SolverName } into temp3
                         select new
                         {
                             SolverName = temp3.Key.SolverName,
                             NumJob = temp3.Sum(t => t.NumJob),
                             CpuTime = temp3.Sum(t => t.CpuTime)
                         };

C#中对DataTable进行全连接后group by,orderby

标签:data   end   res   ase   连接   datatable   csu   job   cpu   

原文地址:http://www.cnblogs.com/johnblogs/p/6958354.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!