以下是引用吹水佬在2016-3-1 08:08:18的发言:
(OCCURS("A", 等级)==3) AND (OCCURS("B", 等级)==5) AND (OCCURS("C", 等级)==1)
CREATE CURSOR Tmp(成绩 C(9))
INSERT INTO Tmp(成绩) VALUES("AAAAAAAAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("CCAAAAAAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("DCAAAAAAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("BBBBBAAAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("CBBBBBAAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("CBBBBBBAA") &&特殊值,另外加的
INSERT INTO Tmp(成绩) VALUES("CDDAABAAA")
INSERT INTO Tmp(成绩) VALUES("CDDACDBBC")
INSERT INTO Tmp(成绩) VALUES("DDDBDDDDC")
INSERT INTO Tmp(成绩) VALUES("BBDABBBBB")
INSERT INTO Tmp(成绩) VALUES("CDDADDCDD")
INSERT INTO Tmp(成绩) VALUES("CDDACDABA")
INSERT INTO Tmp(成绩) VALUES("CDDBDDBDB")
INSERT INTO Tmp(成绩) VALUES("CDDADCCCB")
INSERT INTO Tmp(成绩) VALUES("BCDAAABBB")
INSERT INTO Tmp(成绩) VALUES("DDDBDDDBC")
INSERT INTO Tmp(成绩) VALUES("DBDBCDDDC")
INSERT INTO Tmp(成绩) VALUES("BDDACDBAB")
INSERT INTO Tmp(成绩) VALUES("DDCBDDDDC")
INSERT INTO Tmp(成绩) VALUES("BDDBDDCDD")
INSERT INTO Tmp(成绩) VALUES("CDDBDDCCB")
INSERT INTO Tmp(成绩) VALUES("BBAABBBAA")
INSERT INTO Tmp(成绩) VALUES("BDDABBAAB")
INSERT INTO Tmp(成绩) VALUES("DDDACCCDC")
INSERT INTO Tmp(成绩) VALUES("BBAABBBBA")
INSERT INTO Tmp(成绩) VALUES("BBBABBABB")
INSERT INTO Tmp(成绩) VALUES("DBDAABBAA")
INSERT INTO Tmp(成绩) VALUES("BBDBCBBBB")
INSERT INTO Tmp(成绩) VALUES("BBBAABCAA")
INSERT INTO Tmp(成绩) VALUES("CDDABBCBB")
INSERT INTO Tmp(成绩) VALUES("BBBABBBBA")
INSERT INTO Tmp(成绩) VALUES("BDCABBBBC")
INSERT INTO Tmp(成绩) VALUES("CDDACDBBA")
INSERT INTO Tmp(成绩) VALUES("DDDADDDAC")
INSERT INTO Tmp(成绩) VALUES("ABBAABBAA")
INSERT INTO Tmp(成绩) VALUES("BCAABBBCB")
INSERT INTO Tmp(成绩) VALUES("BBAABBABB")
SELECT * FROM Tmp WHERE OCCURS("D",UPPER(成绩))=0 AND OCCURS("C",UPPER(成绩))<=1 AND OCCURS("B",UPPER(成绩))<=5 INTO CURSOR Tmp_cj
brow