代码乱糟糟,看着头晕,这是JF表中数据汇总?
不管什么方法,能解决问题就是好方法。
不管什么方法,能解决问题就是好方法。
[此贴子已经被作者于2017-10-28 18:00编辑过]
坚守VFP最后的阵地
* VFP9代码 create cursor tt (cj n(7),mc n(7)) =rand(-1) for i=1 to 20000 insert into tt (cj) values (rand()*100) endfor t1=SECONDS() UPDATE tt SET mc=(select COUNT(*)+1 from tt as a WHERE a.cj>tt.cj) MESSAGEBOX(TRANSFORM(RECCOUNT())+"条记录SQL命令运行:"+TRANSFORM(SECONDS()-t1)+" 秒") SELECT tt browse REPLACE mc WITH 0 ALL t1=SECONDS() SELECT tt INDEX on -cj TO mc STORE 1 TO nmc,nrs ncj=0 SCAN IF cj!=ncj nmc=nrs ENDIF REPLACE mc WITH nmc nrs=nrs+1 ncj=cj nmc=mc ENDSCAN MESSAGEBOX(TRANSFORM(RECCOUNT())+"条记录VFP命令运行:"+TRANSFORM(SECONDS()-t1)+" 秒")
UPDATE g2 SET ywnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.语文>g2.语文) && 年级名次 UPDATE g2 SET sxnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.数学>g2.数学) && 年级名次 UPDATE g2 SET yynjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.英语>g2.英语) && 年级名次 UPDATE g2 SET sznjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.三总>g2.三总) && 年级名次 UPDATE g2 SET wlnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.物理>g2.物理) && 年级名次 UPDATE g2 SET hxnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.化学>g2.化学) && 年级名次 UPDATE g2 SET swnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.生物>g2.生物) && 年级名次 UPDATE g2 SET zfnjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.总分>g2.总分) && 年级名次 UPDATE g2 SET ywbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.语文>g2.语文 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET sxbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.数学>g2.数学 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET yybjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.英语>g2.英语 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET szbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.三总>g2.三总 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET wlbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.物理>g2.物理 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET hxbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.化学>g2.化学 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET swbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.生物>g2.生物 AND a.bj=g2.bj) && 班级名次 UPDATE g2 SET zfbjmc=(select COUNT(a.bj)+1 from g2 as a WHERE a.总分>g2.总分 AND a.bj=g2.bj) && 班级名次