欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

C# ling to sql 取多条记录最大时间

程序员文章站 2022-05-07 17:01:45
var _setList = (from f in _postgreDbContext.settlements group f by ( new { f.settlement_code })into g select new { deal_time = g.Max(m => m.deal_time)... ......
     var _setlist = (from f in _postgredbcontext.settlements
                              
                                 group f by ( new { f.settlement_code })into g
                                 select new
                                 {
                                     deal_time = g.max(m => m.deal_time),
                                     g.key.settlement_code

                                 }).asnotracking().tolist();