0
我有数据表中的列数据表自组选择和列通过
transactionid,tenderid,amount,bankcode,CardType
我需要通过transactionid,tenderid,bankcode,CardType
这从它组中选择transactionid,tenderid,Sum(amount),bankcode,CardType
是我达到了,但我不知道我应该键入选择
dttransactiontenders= dttransactiontenders.AsEnumerable()
.GroupBy(r => new { Col1 = r["transactionid"], Col2 = r["tenderid"], Col3 = r["bankcode"], Col4 = r["CardType"] })
.Select(g => g.OrderBy(r => r["transactionid"]).First())
.CopyToDataTable();
感谢您的帮助,相反,你可以使用这种方法 – CODER