几种考试排场和编号方法
(2013-09-03 08:41:56)
标签:
考场编排 |
分类: 考生号考场号座位号 |
1、随机无规律插花排序法
&& 表b1为原表,给b1增加一新列 Sjh,生成新表b2
Select Rand() As Sjh,* From B1 Into Table B2
&& 按 Sjh 排序,生成新表b3
Select * From B1 Order By Sjh Into Table B3
&& 给b3增加一新列 Xh,生成新表b4 (结果表)
Select Recn() As Xh,* From B2 Order By Xh Into Table B4
Drop
Table B2
Drop
Table B3
2、指定规律插花排序法
** 根据人数多少搭配相等的五组数据,生成五个临时表
Sele * From Bmk Where Bmxh In([01]) Into Cursor B1
Sele * From Bmk Where Bmxh In([03],[04]) Into Cursor B2
Sele * From Bmk Where Bmxh In([02]) Into Cursor B3
Sele * From Bmk Where Bmxh In([06]) Into Cursor B4
Sele * From Bmk Where Bmxh In([07],[05]) Into Cursor B5
** 把五个临时表合并,按第一列‘Xh’排序,即生成五组插花排序的数据
Sele Recn() Xh,* From B1;
Union Sele Recn() Xh,* From B2;
Union Sele Recn() Xh,* From B3;
Union Sele Recn() Xh,* From B4;
Union Sele Recn() Xh,* From B5 Order By 1 Into Table B6
3、准考证号的生成方法
(1)、在表中有记录的情况下使用函数recn(),生成数值型准考证号命令如下:
(2)、利用函数生成字符型序列(0000---9999)
(3)、生成开头为'0'的字符型准考证号(07140001-07149999)
(4)、字符型准考证号也可以用以下方法(在考场_kc、座号_zh生成后使用)
4、考场号与座号的生成方法
(1)、数值型考场号、座号(如1 2 3 ...10 11 12)
(2)、字符型考场号、座号(如01 02 03 ...10 11)
【注意】这样添加考场与座号列,必须用插花排序法排好顺序。
5、利用随机函数编排考场的程序
**========================================================================
** 程序名称:利用随机函数排考场程序
** 程序设计:侯进录
** 编程时间:2006年12月25日
**=========================================================================
** 生成随机号列
Select Round(Rand(),9) Sjh,* From Bmk Into Cursor B1
** 按随机号排序
Select * From B1 Order By Sjh Desc Into Cursor B2
** 生成字符型准考证号
Select[07]+Alltrim(Str(140000+Recn())) As
准考证号,;
Right(Alltrim(Str(9000+Ceiling(Recn()/30))),3) As
考场号,;
Right(Alltrim(Str(900+Recn();
-(Ceiling(Recn()/30)-1)*30)),2) As
Into Table 考场编排表
6、利用指定分组编排考场的程序
**=======================================================================
** 程序名称:排序
** 程序功能:多组插花
** 编程人员:侯进录
**======================================================================
** 根据人数多少搭配相等的五组数据,生成五个临时表
Sele * From Bmk Where Bmxh In([01]) Into Cursor B1
Sele * From Bmk Where Bmxh In([03],[04]) Into Cursor B2
Sele * From Bmk Where Bmxh In([02]) Into Cursor B3
Sele * From Bmk Where Bmxh In([06]) Into Cursor B4
Sele * From Bmk Where Bmxh In([07],[05]) Into Cursor B5
** 把五个临时表合并,按第一列‘Xh’排序,即生成五组插花排序的数据
Sele Recn() Xh,* From B1;
Union Sele Recn() Xh,* From B2;
Union Sele Recn() Xh,* From B3;
Union Sele Recn() Xh,* From B4;
Union Sele Recn() Xh,* From B5 Order By 1 Into Table B6
Select[07]+Alltrim(Str(140000+Recn())) As
准考证号,;
**
Right(Alltrim(Str(9000+Ceiling(Recn()/30))),3) As
考场号,;
Right(Alltrim(Str(900+Recn();
-(Ceiling(Recn()/30)-1)*30)),2)