Dim cnt As Integer = DataTables("表A").DataRows.Count
Dim vals() As Double = {0.1,0.25,0.4,0.20}
Dim tops(3) As Integer
For i As Integer = 0 To vals.length - 1
tops(i) = Math.Floor(cnt * vals(i))
Next
Dim djs() As String = {"A","B","C","D"}
Dim drs As List (of DataRow)
For k As Integer = 0 To tops.length - 1
drs = DataTables("表A").SQLSelect("等级 is null",tops(k), "分数 Desc")
For i As Integer = 0 To drs.Count - 1
drs(i)("等级") = djs(k)
Next
DataTables("表A").SQLUpdate(drs)
Next
DataTables("表A").SQLReplaceFor("等级","E", "等级 is null")
DataTables("表A").Load
Tables("表A").Sort = "分数 Desc"