标题:请教,指正“本来想是27行,为何是21行”
取消只看楼主
b土木丁口
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:264
专家分:189
注 册:2013-9-12
得分:0 
可我是要以“概桥率1”排序呀
2013-11-26 15:43
b土木丁口
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:264
专家分:189
注 册:2013-9-12
得分:0 
谢谢
2013-11-26 16:20
b土木丁口
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:264
专家分:189
注 册:2013-9-12
得分:0 
请大侠检查一下:
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
2013-11-27 09:18
b土木丁口
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:264
专家分:189
注 册:2013-9-12
得分:0 
已经达到预期
2013-11-27 09:49



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-424173-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.408970 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved