Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
名称 城市 ID
C 休斯顿 12 A 伦敦 36 B 休斯顿 25 A 伦敦 40
输出:
伦敦 36 伦敦 40
我有一个 DataTable 并想返回所有重复的行(仅基于 Name 和 City 列)有什么帮助吗?
谢谢!
您可以运行下面的 LINQ 语句
var l = (from r in table group r by new { a.Name, a.City } into g where g.Count() > 1 select g).SelectMany(g => g).ToList();