SELECT zf,(SELECT count(*)+1 FROM 成绩表 WHERE a.zf<zf) as jmc FROM 成绩表 as a
加个kh字段 SELECT kh,zf,(SELECT count(*)+1 FROM 成绩表 WHERE a.zf<zf) as jmc FROM 成绩表 as a into curs lsb scan upda 表 set jmc=lsb.jmc where allt(kh)=allt(lsb.kh) ends