标题:如何在一个表中寻找出某个字段中的记录它们的长度相同但内容不同
只看楼主
sdta
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:江苏省连云港市
等 级:版主
威 望:323
帖 子:9621
专家分:26174
注 册:2012-2-5
得分:0 
程序代码:
CLOSE DATABASES
SELECT 报名点代码, SPACE(4) 科目 FROM Ls2 WHERE .F. INTO CURSOR Test READWRITE 
SELECT Ls2
SCAN
    FOR i =1 TO ALINES(aBkkm, 报考科目, 1, ",")
        INSERT INTO Test VALUES (Ls2.报名点代码,aBkkm[i])
    ENDFOR 
ENDSCAN
SELECT DISTINCT 科目 FROM Test INTO ARRAY aKm
cField = "报名点代码 C(6)"
FOR i = 1 TO ALEN(aKm)
    cField = cField + "," +aKm[i] + " N(4)"
ENDFOR
CREATE CURSOR Stat_Resu (&cField)
INSERT INTO Stat_Resu (报名点代码) SELECT DISTINCT 报名点代码 FROM Test
INDEX ON 报名点代码 TAG Dm
SELECT Test
SET RELATION TO 报名点代码 INTO Stat_Resu
SCAN 
    REPLACE (Test.科目) WITH EVALUATE(Test.科目) + 1 IN Stat_Resu
ENDSCAN
SET RELATION TO 
SELECT Stat_Resu
SET ORDER TO 
BROWSE 

坚守VFP最后的阵地
2018-09-25 21:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-431813-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.823566 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved