SQL server存储过程题目
发布网友
发布时间:2022-10-12 16:13
我来回答
共1个回答
热心网友
时间:2023-10-22 22:17
declare @tmp table(grade int)
insert @tmp
select grade from choice
declare @i int
set @i =0
while (select sum (case when grade >50 then 1.0 else 0.0 end )*100.0 /CONVERT(float,count(*)) from @tmp ) >50
begin
update @tmp set grade = grade +1
set @i = @i +1
end
print '最终加了' +convert(nvarchar,@i) +'分'