using System.Collections.Generic;
public static void Main()
List<TABLEA> tableas = new List<TABLEA>()
new TABLEA(001, "iphone", 9890),
new TABLEA(002, "iphone pro max", 9890),
new TABLEA(003, "iphone se", 9890),
new TABLEA(004, "iphone", 7847),
new TABLEA(008, "samsung", 9432),
new TABLEA(009, "samsung s10", 9432),
new TABLEA(010, "orange", 34)
.GroupBy(x => x.regNumber)
.Select(x => new {Description = x.First().Desc, regNumber=x.Key, TotalCount = x.Count()})
.OrderByDescending(x => x.TotalCount)
Console.WriteLine($"{result.Description} {result.regNumber} {result.TotalCount}");
public int Id { get; set;}
public string Desc { get; set;}
public int regNumber { get; set;}
public TABLEA(int id, string desc, int regNumber)
this.regNumber = regNumber;