发布网友 发布时间:2022-04-24 03:23
共1个回答
热心网友 时间:2023-10-24 16:39
create proc sumvalues
@s int=10,
@e int=20
as
declare @sum int=0
while(@s<@e)
begin
if(@s%2=0)
begin
set @sum=@sum+@s
end
set @s=@s+1
end
select @sum
---下面为取值调用
exec sumvalues 10,20
热心网友 时间:2023-10-24 16:39
create proc sumvalues
@s int=10,
@e int=20
as
declare @sum int=0
while(@s<@e)
begin
if(@s%2=0)
begin
set @sum=@sum+@s
end
set @s=@s+1
end
select @sum
---下面为取值调用
exec sumvalues 10,20
热心网友 时间:2023-10-24 16:39
create proc sumvalues
@s int=10,
@e int=20
as
declare @sum int=0
while(@s<@e)
begin
if(@s%2=0)
begin
set @sum=@sum+@s
end
set @s=@s+1
end
select @sum
---下面为取值调用
exec sumvalues 10,20
热心网友 时间:2023-10-24 16:39
create proc sumvalues
@s int=10,
@e int=20
as
declare @sum int=0
while(@s<@e)
begin
if(@s%2=0)
begin
set @sum=@sum+@s
end
set @s=@s+1
end
select @sum
---下面为取值调用
exec sumvalues 10,20