网友您好, 请在下方输入框内输入要搜索的题目:
请说出该程序段的功能。
declare @e numeric(5,2)
declare @ c1 int, @ c2 int, @ c3 int, @ c4 int
set @ c1=0; set @ c2 =0; set @ c3=0; set @ c4=0
declare xxx cursor
for select 成绩 from score
open xxx
fetch xxx into @ c
while @'@ fetch_status = 0
begin
if(@c > =90) set @cl =@ e1 +1;
else if( @ c > =70) set @ c2 =@ c2 +1;
else if(@ c> =60) set @ c3 =@ c3 +1;
else set @ c4 = @ c4 + 1
fetch from xxx into @ c
end
close xxx
deallocate xxx
print 优秀生人数:'+sb(@ c1,5);
print食好生人数:'+str(@ c2,5);
print及格生人数:'+str(@ c3,5);
print及格生人数:'+sh(@ c4,5)
参考答案