Foxtable(狐表)用户栏目专家坐堂 → 删除重复行


  共有5459人关注过本帖树形打印复制链接

主题:删除重复行

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107847 积分:548592 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/10/13 8:47:00 [显示全部帖子]

Dim i As Integer
Dim dr1 As DataRow = DataTables("BOM清单").DataRows(DataTables("BOM清单").DataRows.Count - 1)
Dim dr As DataRow
For i = DataTables("BOM清单").DataRows.Count - 2 To 0 Step - 1
    dr = DataTables("BOM清单").DataRows(i)
    If dr("母件编码") = dr1("母件编码") AndAlso dr("子件编码") = dr1("子件编码") Then
        dr.delete
    Else
        DataTables("BOM清单").save
        DataTables("BOM清单").SQLDeleteFor("母件编码 = '" & dr1("母件编码") & "' And 子件编码 = '" & dr1("子件编码") & "' and _Identify <> " & dr1("_Identify"))
        dr1 = dr
    End If 
    
Next
DataTables("BOM清单").save
DataTables("BOM清单").SQLDeleteFor("母件编码 = '" & dr1("母件编码") & "' And 子件编码 = '" & dr1("子件编码") & "' and _Identify <> " & dr1("_Identify"))

 回到顶部