生日提醒问题
declare @name varchar(10),@num int,@names varchar(100)
set @num=1Set @names=' '
while @num<=(select COUNT(*) from student2)
begin
set @name=(select st_name from student2
where MONTH(GETDATE())=MONTH(st_birthday)and st_count=@num)
if LEN(@name)<>0
set @names=@names+@name+' '
if @num=(select COUNT(*) from student2)
print @names+ '生日快乐哦!'
set @num=@num+1
end
加分到100产生溢出问题
while (select AVG(st_score) from score)<90
begin
update score
set st_score=st_score*1.2
update score
set st_score=100 where st_score>100
end