完全没有移动
With dt.Table
For ia0 As Integer = .Rows.Count - 2 To 0
If .Rows(ia0)("排序") = 0 Then
.Rows(ia0).Move(.Rows.Count - 1)
End If
Next
.Save()
Dim tz1 As Integer = .Compute("Count(姓名)","[排序] = 0")
For ia1 As Integer = 0 To .rows.count - tz1 - 1 Step 2
If ia1+1 < .Rows.Count - tz1 - 1 Then
Dim dr2a1 As DataRow = DataTables("比赛积分").SQLFind("[团体赛或个人赛] = '" & lx & "' And [棋赛名称] = '" & di1 & "' And [第几轮比赛] = '" & Cstr(Val(di2)-1) & "' And [分组] = '" & Str & "' And ([编号] = '" & .Rows(ia1)("编号") & "'or [姓名] = '" & .Rows(ia1)("姓名") & "')")
Dim dr2a2 As DataRow = DataTables("比赛积分").SQLFind("[团体赛或个人赛] = '" & lx & "' And [棋赛名称] = '" & di1 & "' And [第几轮比赛] = '" & Cstr(Val(di2)-1) & "' And [分组] = '" & Str & "' And ([编号] = '" & .Rows(ia1+1)("编号") & "'or [姓名] = '" & .Rows(ia1+1)("姓名") & "')")
If dr2a1 IsNot Nothing And dr2a2 IsNot Nothing And dr2a1("排序") = dr2a2("排序") Then
.Rows(ia1+1).Move(ia1+2)
End If
End If
Next
.Save()
End With