* VFP9.0代码 cc='" " c1," " c2," " c3' && 保存标记 SELECT 班级,总分,&cc FROM 学校 ORDER BY 总分 DESC INTO CURSOR tt READWRITE cmc="40,160,700" && 前N名 =ALINES(amc,cmc,",") FOR i=1 TO ALEN(amc,1) GO VAL(amc[i]) zf=总分 REPLACE ALL ("c"+TRANSFORM(i)) WITH "c" FOR 总分>=zf &&符合条件的加标记 ENDFOR SELECT 班级,CAST(SUM(IIF(EMPTY(c1),0,1)) as n(6)) 前40名,; CAST(SUM(IIF(EMPTY(c2),0,1)) as n(6)) 前160名,; CAST(SUM(IIF(EMPTY(c3),0,1)) as n(6)) 前700名 ; FROM tt GROUP BY 班级 ORDER BY 班级
[此贴子已经被作者于2017-10-26 11:14编辑过]