Tag: 密级

用linq实现密集排名

使用以下linq代码,如何在我的结果中添加dense_rank? 如果这太慢或太复杂,那么只有排名窗口function怎么样? var x = tableQueryable .Where(where condition) .GroupBy(cust=> new { fieldOne = cust.fieldOne ?? string.Empty, fieldTwo = cust.fieldTwo ?? string.Empty}) .Where(g=>g.Count()>1) .ToList() .SelectMany(g => g.Select(cust => new { cust.fieldOne , cust.fieldTwo , cust.fieldThree }));