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.
我有一个数据表,如下所示:
从这些我需要获得statecountyid基于source和sourcenickname列的最大值。
statecountyid
source
sourcenickname
结果应该是:
试试下面的代码:
var result = from row in tbl.AsEnumerable() group row by new {sourceKey = row["source"],sourcenicknamekey = row["sourcenickname"]} into g select new { maxSCIds = g.Max(x => x["statecountyid"]) };