Dim s As New List(Of String)
Dim drs As List(Of DataRow) = DataTables("表A").Select("","第一列,第三列")
For Each dr As DataRow In drs
Dim dr1 As DataRow = DataTables("表A").Find("第一列 = '" & dr("第一列") & "'","第三列 desc",1)
If dr1 IsNot Nothing And s.Contains(dr("第一列")) = False Then
s.Add(dr("第一列"))
dr("第二列") = dr("第二列") & "," & dr1("第二列")
dr("第三列") = dr("第三列") + dr1("第三列")
dr1.delete()
dr.Save()
End If
Next
[此贴子已经被作者于2020/9/19 12:18:16编辑过]