回复 20楼 laowan001
只10条的话是不会很多,从遍历的角度讲也不多的,但每一次替换时都是以原来的A为标准被B的随机几行替换了,所以相似度也不会越来越高的[此贴子已经被作者于2022-2-15 08:08编辑过]
CREATE CURSOR ta (bh I, f1 C(4)) CREATE CURSOR tb (bh I, f1 C(4)) FOR i=1 TO 9 INSERT INTO ta VALUES (i,"a"+TRANSFORM(i)) INSERT INTO tb VALUES (i,"b"+TRANSFORM(i)) ENDFOR SELECT ta INDEX on bh TAG ta_bh RAND(-1) SELECT tb INDEX ON RAND() TAG tb_r SET RELATION TO bh INTO "ta" ran = INT((RECCOUNT("tb")-1)*RAND()+1) ? " 取 "+TRANSFORM(ran)+" 条记录" i = 0 SCAN FOR i<ran ? bh,f1 i = i+1 SCATTER MEMVAR SELECT ta GATHER MEMVAR ENDSCAN SELECT * FROM ta