1.先获得最大值的汇总数据
Dim tem1 = From k In lstCPMasterTemp _Group k By code = k.CpCode Into g = Group,maxVersion = Max(k.Version) _
Select code,maxVersion
m_lstCPMaster = (From k In lstCPMasterTemp _
Join g In tem1 On g.code Equals k.CpCode And g.maxVersion Equals k.Version _
Select k).ToList
原文链接:https://www.f2er.com/vb/258835.html