查30.10,停在30.20的位置
CLOSE ALL CLEAR ALL clea SET near ON SELECT 1 USE pfb INDEX on cj TO cj SET FILTER TO xb="1" SELECT 2 USE cjk SCAN FOR xb="1" SEEK b.cj IN a REPLACE fs WITH a.fs ENDSCAN SET FILTER TO xb="2" IN a SCAN FOR xb="2" SEEK b.cj IN a REPLACE fs WITH a.fs ENDSCAN
CLOSE DATABASES all LOCAL ofile,sfile ofile=GETFILE([dbf],[确定成绩表]) sfile=GETFILE([dbf],[确定标准表]) USE (ofile) IN 0 ALIAS mb EXCLUSIVE USE (sfile) IN 0 ALIAS bz EXCLUSIVE *!* SELECT a.bmxh,MAX(b.fs) FROM mb a LEFT JOIN bz b ON a.xb=b.xb AND a.zx=b.xm AND b.cj-a.cj>=0 GROUP BY a.bmxh UPDATE mb SET mb.fs=c.fs from (SELECT a.bmxh,MAX(b.fs) as fs FROM mb a LEFT JOIN bz b ON a.xb=b.xb AND a.zx=b.xm AND b.cj-a.cj>=0 GROUP BY a.bmxh)c WHERE mb.bmxh=c.bmxh SELECT mb brow