是不是这个意思? (注意表内大小写)
close all
nss=1
select recno() as no,* from xm into cursor x0 order by personid
select x0
go top
do while !EOF()
c01=ALLTRIM(personid)
skip
c02=ALLTRIM(personid)
nrec=no
if c01==c02
select xm
go nrec
replace personid with (ALLTRIM(personid)+TRANSFORM(nss))
nss=nss+1
else
nss=1
endif
select x0
enddo
select xm
go top
browse