*试下
SELECT * FROM PX.DBF INTO CURSOR FXCURSOR ORDER BY 总分赋分 DESC READWRITE
SELECT PX
USE
SELECT FXCURSOR
GO TOP
b1=ALLTRIM(班级)
x1=ALLTRIM(姓名)
f1=总分赋分
DELETE
IF USED('aa')
SELECT aa
USE
ENDIF
CREATE CURSOR AA(x C(10),B C(10), f n(10))
APPEND BLANK
REPLACE X WITH X1 ,b WITH b1
REPLACE f WITH f1
DO WHILE .t.
SELECT FXCURSOR
LOCATE FOR .not. b1=ALLTRIM(班级) .and. .not. delete()
IF FOUND()
b2=ALLTRIM(班级)
x2=ALLTRIM(姓名)
f2=总分赋分
f1=总分赋分
b1=ALLTRIM(班级)
x1=ALLTRIM(姓名)
dele
SELECT aa
APPEND BLANK
REPLACE x WITH x2,b WITH b2,f WITH f2
LOOP
ELSE
LOCATE FOR .not.delete()
IF FOUND()
b2=ALLTRIM(班级)
x2=ALLTRIM(姓名)
f2=总分赋分
f1=总分赋分
b1=ALLTRIM(班级)
x1=ALLTRIM(姓名)
dele
SELECT aa
APPEND BLANK
REPLACE x WITH x2,b WITH b2,f WITH f2
ELSE
exit
ENDIF
ENDIF
ENDDO
SELECT FXCURSOR
USE
SELECT aa
BROWSE