Foxtable(狐表)用户栏目专家坐堂 → 如何根据条件替换重复数据


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

主题:如何根据条件替换重复数据

帅哥哟,离线,有人找我吗?
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4752 积分:34568 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2016/7/17 23:20:00 [显示全部帖子]

Dim cmd As New SQLCommand
cmd.CommandText = "s elect [_Identify] from"
cmd.CommandText += "(s elect 户号, max(年龄) As 年龄 from {表A} group by 户号) as a"
cmd.CommandText += " inner join {表A} as b on a.户号 = b.户号 And a.年龄 = b.年龄"
Dim dt As DataTable = cmd.ExecuteReader()
DataTables("表A").DeleteFor("_Identify not in (" & dt.GetComboListString("_Identify").Replace("|",",") & ")")

 回到顶部