vf查重号

来源:百度知道 编辑:UC知道 时间:2024/08/20 08:45:31
在vf数据库中查询一个字段中有没有相同的值。如a.dbf中字段xh为学号,为了确定他没有重复的,怎么查询看看有没有重复的啊!拜托

用这条语句能查出第一个有重复的记录
select xh from a.dbf group by xh having count(*)>1)
以下就是全部有重复的
select * from a.dbf where xh in (select xh from a.dbf group by xh having count(*)>1)

for i=1 to recc()
goto i
xhxh=xh
coun all for xhxh=xh to zs
if zs>1 then i=recc()+234
end for
if i>recc()+20
messagebox("重号了")
else
messagebox("没有重号")

end if