请大侠检查一下:
SET EXCLUSIVE ON
SET SAFETY OFF
close
all
&&一、第一列
use e:\xyz
dele all
pack
append from h:\2013\xyz2
*求概桥率
do h:\2013\2012\12001\12001
*排序
sele * from e:\6 into cursor tmp888 order by 概桥率1 desc
close
all
use e:\xyz
i=1
do while .not. eof()
repl 概桥排名1 with i
skip
i=i+1
enddo
close
all
&&二、加第二列
close
all
use e:\xyz
INSERT INTO e:\xyz SELECT
* FROM e:\xyz union all SELECT * FROM e:\xyz
UPDATE e:\xyz SET 第二列=2 WHERE BETWEEN(RECNO(),1,3)
UPDATE e:\xyz SET 第二列=1 WHERE BETWEEN(RECNO(),4,6)
UPDATE e:\xyz SET 第二列=0 WHERE BETWEEN(RECNO(),7,9)
*加序号
use e:\xyz
i=1
do while .not. eof()
repl 序号 with i
skip
i=i+1
enddo
*求概桥率
do h:\2013\2012\12001\12001
close
all
*排序
use e:\xyz
sort to d:\vfp98\5 on 概桥率2/d
close
all
*加 “概桥排名2”序号
use d:\vfp98\5
i=1
do while .not. eof()
repl 概桥排名2 with i
skip
i=i+1
enddo
use e:\xyz
dele all
pack
append from d:\vfp98\5
drop table d:\vfp98\5
**以序号升序排序
use e:\xyz
sele * from e:\xyz into dbf tmp1 order by 序号 asc
close data
use e:\xyz
zap
appe from tmp1
dele file tmp1.dbf
&&三、加第三列
RELEASE myarrar
close
all
use e:\xyz
INSERT INTO e:\xyz SELECT
* FROM e:\xyz union all SELECT * FROM e:\xyz
UPDATE e:\xyz SET 第三列=2 WHERE BETWEEN(RECNO(),1,9)
UPDATE e:\xyz SET 第三列=1 WHERE BETWEEN(RECNO(),10,18)
UPDATE e:\xyz SET 第三列=0 WHERE BETWEEN(RECNO(),19,27)
*加序号
use e:\xyz
i=1
do while .not. eof()
repl 序号 with i
skip
i=i+1
enddo
*求概桥率
do h:\2013\2012\12001\12001
close
all
*排序
use e:\xyz
sort to d:\vfp98\5 on 概桥率3/d
close
all
*加”概桥排名3”序号
use d:\vfp98\5
i=1
do while .not. eof()
repl 概桥排名3 with i
skip
i=i+1
enddo
use e:\xyz
dele all
pack
append from d:\vfp98\5
drop table d:\vfp98\5
**以序号升序排序
use e:\xyz
sele * from e:\xyz order by 序号 asc
*对 e:\xyz 排序结果放在临时表 tmp1
sele * from e:\xyz into dbf tmp1 order by 序号 asc
close data
use e:\xyz
*清空e:\ xyz
zap
*把排序结果放在临时表 tmp1中的内容放回
appe from tmp1
*删除临时表 tmp1
dele file tmp1.dbf
&&四、加第四列
RELEASE myarrar
close
all
use e:\xyz
INSERT INTO e:\xyz SELECT
* FROM e:\xyz union all SELECT * FROM e:\xyz
UPDATE e:\xyz SET 第四列=2 WHERE BETWEEN(RECNO(),1,27)
UPDATE e:\xyz SET 第四列=1 WHERE BETWEEN(RECNO(),28,54)
UPDATE e:\xyz SET 第四列=0 WHERE BETWEEN(RECNO(),55,81)
*加序号
use e:\xyz
i=1
do while .not. eof()
repl 序号 with i
skip
i=i+1
enddo
*求概桥率
do h:\2013\2012\12001\12001
close
all
*排序
use e:\xyz
sort to d:\vfp98\5 on 概桥率4/d
close
all
*加”概桥排名4”序号
use d:\vfp98\5
i=1
do while .not. eof()
repl 概桥排名4 with i
skip
i=i+1
enddo
use e:\xyz
dele all
pack
append from d:\vfp98\5
drop table d:\vfp98\5
**以序号升序排序
use e:\xyz
sele * from e:\xyz order by 序号 asc
*对 e:\xyz 排序结果放在临时表 tmp1
sele * from e:\xyz into dbf tmp1 order by 序号 asc
close data
use e:\xyz
*清空e:\ xyz
zap
*把排序结果放在临时表 tmp1中的内容放回
appe from tmp1
*删除临时表 tmp1
dele file tmp1.dbf