时间:2011-12-29 20:47:40
11
sele count(学号) as 选课人数 from 选课,课程 ;
where 课程名称=allt(thisform.list1.value) and 选课.课程号=课程.课程号;
into table allt(thisform.list1.value)
12
sele 民族,avg(语文)as 语文平均分,avg(数学)as 数学平均分;
from xs,cj where xs.学号=cj.学号 and 民族="汉";
into array a
sele 民族,avg(语文)as 语文平均分,avg(数学)as 数学平均分;
from xs,cj where xs.学号=cj.学号 and 民族!="汉";
into array b
insert into newcj from array a
insert into newcj from array b
update newcj set 民族="其他" where 民族!="汉"
13
(1)sele 国家名称,count(名次) as 奖牌总数;
from 国家,获奖牌情况 where 国家.国家代码=获奖牌情况.国家代码;
group by 获奖牌情况.国家代码 order by 奖牌总数 desc,国家名称;
into table 临时奖牌榜
14
do case
case thisform.check1.value=1 and thisform.check2.value=1
if thisform.optiongroup1.value=1
sele 教师号,姓名,系名,课程号,工资 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 into table both
else
sele 教师号,姓名,系名,课程号,工资 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 desc into table both
endif
case thisform.check1.value=1 and thisform.check2.value=0
if thisform.optiongroup1.value=1
sele 教师号,姓名,系名,课程号 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 into table otherxm
else
sele 教师号,姓名,系名,课程号 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 desc into table otherxm
endif
case thisform.check1.value=0 and thisform.check2.value=1
if thisform.optiongroup1.value=1
sele 教师号,姓名,工资,课程号 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 into table othergz
else
sele 教师号,姓名,工资,课程号 from 教师,院系;
where 教师.系号=院系.系号 order by 教师号 desc into table othergz
endif
endcase