***凑合用吧
close database
use 流动红旗登记原始表 in 0 alias hq
delete for recno()>20
pack
append blank
for i=2 to fcount()-1
sum evaluate(field(i)) to xj
replace record reccount() (field(i)) with xj
endfor
scatter fields like *班 to a
dimension a[alen(a),1]
create cursor tt (n1 n(2))
insert into tt from array a
select n1,recno() bj from tt into cursor tt
select n1,bj from tt order by 1 desc into cursor tt
select recno() bj1 from tt order by bj into array b
dimension b[1,alen(b)]
select hq
append blank
replace from array b fields 一班,二班,三班,四班,五班,六班,七班,八班,九班,十班
for i=2 to fcount()-1
blank record reccount() fields (field(i)) for evaluate(field(i))>5
endfor
browse