linq to sql Distinct and orderby

前端 未结 3 458
陌清茗
陌清茗 2020-12-20 10:54
var result = table1.Join(table2, o => o.ProgramID, t => t.ProgramID, (o, t) => new { o.ProgramID, t.Program })
         .OrderBy(t => t.Program)
                 


        
3条回答
  •  感情败类
    2020-12-20 11:33

    I don't know if it will help, but you can try something like this;

    var result = (from o in table1
                  join t in table2 on o.ProgramID equals t.ProgramID
                  orderby t.Program
                  select new { o.ProgramID, t.Program }).Distinct();
    

提交回复
热议问题